mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 03:11:34 +00:00
Merge branch 'lua_fix_onActorActive' into 'master'
Validate that object exists before onActorActive Lua handler See merge request OpenMW/openmw!1580
This commit is contained in:
commit
39c7325db7
1 changed files with 7 additions and 1 deletions
|
@ -200,7 +200,13 @@ namespace MWLua
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ObjectId id : mActorAddedEvents)
|
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();
|
mActorAddedEvents.clear();
|
||||||
|
|
||||||
if (!mWorldView.isPaused())
|
if (!mWorldView.isPaused())
|
||||||
|
|
Loading…
Reference in a new issue