From d7acec74fdd03de00ce6a9a7c0e107f29020ba0c Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 13 Oct 2016 14:38:35 +0200 Subject: [PATCH] Fix the cell changed flag no longer being reset after the player dies --- apps/openmw/engine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 62457cae6..c6cabffa3 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -120,16 +120,21 @@ void OMW::Engine::frame(float frametime) // global scripts mEnvironment.getScriptManager()->getGlobalScripts().run(); } - - mEnvironment.getWorld()->markCellAsUnchanged(); } + } + mEnvironment.getWorld()->markCellAsUnchanged(); + + if (mEnvironment.getStateManager()->getState()== + MWBase::StateManager::State_Running) + { if (!guiActive) { double hours = (frametime * mEnvironment.getWorld()->getTimeScaleFactor()) / 3600.0; mEnvironment.getWorld()->advanceTime(hours, true); } } + osg::Timer_t afterScriptTick = osg::Timer::instance()->tick(); // update actors