1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00

Validate that object exists before onActorActive Lua handler

This commit is contained in:
Petr Mikheev 2022-01-23 11:30:22 +01:00
parent c263bbf0f6
commit 24989e7bc1

View file

@ -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())