Validate that object exists before onActorActive Lua handler

ptmikheev-master-patch-38354
Petr Mikheev 3 years ago
parent c263bbf0f6
commit 24989e7bc1

@ -200,7 +200,13 @@ namespace MWLua
}
for (ObjectId id : mActorAddedEvents)
mGlobalScripts.actorActive(GObject(id, objectRegistry));
{
GObject obj(id, objectRegistry);
if (obj.isValid())
mGlobalScripts.actorActive(obj);
else
Log(Debug::Verbose) << "Can not call onActorActive engine handler: object" << idToString(id) << " is already removed";
}
mActorAddedEvents.clear();
if (!mWorldView.isPaused())

Loading…
Cancel
Save