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:
parent
c263bbf0f6
commit
24989e7bc1
1 changed files with 7 additions and 1 deletions
|
@ -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…
Reference in a new issue