mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-12 21:36:43 +00:00
Fixes #1296: Streamlined cellChanged detection
This commit is contained in:
parent
42b332775a
commit
6eca5ac4bb
1 changed files with 2 additions and 10 deletions
|
@ -59,9 +59,6 @@ void OMW::Engine::executeLocalScripts()
|
||||||
MWScript::InterpreterContext interpreterContext (
|
MWScript::InterpreterContext interpreterContext (
|
||||||
&script.second.getRefData().getLocals(), script.second);
|
&script.second.getRefData().getLocals(), script.second);
|
||||||
MWBase::Environment::get().getScriptManager()->run (script.first, interpreterContext);
|
MWBase::Environment::get().getScriptManager()->run (script.first, interpreterContext);
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWorld()->hasCellChanged())
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
localScripts.setIgnore (MWWorld::Ptr());
|
localScripts.setIgnore (MWWorld::Ptr());
|
||||||
|
@ -101,15 +98,10 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
|
||||||
// global scripts
|
// global scripts
|
||||||
MWBase::Environment::get().getScriptManager()->getGlobalScripts().run();
|
MWBase::Environment::get().getScriptManager()->getGlobalScripts().run();
|
||||||
|
|
||||||
bool changed = MWBase::Environment::get().getWorld()->hasCellChanged();
|
|
||||||
|
|
||||||
// local scripts
|
// local scripts
|
||||||
executeLocalScripts(); // This does not handle the case where a global script causes a
|
executeLocalScripts();
|
||||||
// cell change, followed by a cell change in a local script during
|
|
||||||
// the same frame.
|
|
||||||
|
|
||||||
if (changed) // keep change flag for another frame, if cell changed happened in local script
|
MWBase::Environment::get().getWorld()->markCellAsUnchanged();
|
||||||
MWBase::Environment::get().getWorld()->markCellAsUnchanged();
|
|
||||||
|
|
||||||
if (!paused)
|
if (!paused)
|
||||||
MWBase::Environment::get().getWorld()->advanceTime(
|
MWBase::Environment::get().getWorld()->advanceTime(
|
||||||
|
|
Loading…
Reference in a new issue