1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

run targeted scripts with an implicit reference based on the ID given

This commit is contained in:
Marc Zinnschlag 2014-07-17 09:15:41 +02:00
parent e8322da663
commit dba6a9ebff

View File

@ -75,8 +75,15 @@ namespace MWScript
{
if (iter->second.mRunning)
{
MWWorld::Ptr ptr;
if (!iter->second.mId.empty())
ptr = MWBase::Environment::get().getWorld()->getPtr (
iter->second.mId, false);
MWScript::InterpreterContext interpreterContext (
&iter->second.mLocals, MWWorld::Ptr());
&iter->second.mLocals, ptr);
MWBase::Environment::get().getScriptManager()->run (iter->first, interpreterContext);
}
}