mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +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 ( | ||||
|             &script.second.getRefData().getLocals(), script.second); | ||||
|         MWBase::Environment::get().getScriptManager()->run (script.first, interpreterContext); | ||||
| 
 | ||||
|         if (MWBase::Environment::get().getWorld()->hasCellChanged()) | ||||
|             break; | ||||
|     } | ||||
| 
 | ||||
|     localScripts.setIgnore (MWWorld::Ptr()); | ||||
|  | @ -101,14 +98,9 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) | |||
|             // global scripts
 | ||||
|             MWBase::Environment::get().getScriptManager()->getGlobalScripts().run(); | ||||
| 
 | ||||
|             bool changed = MWBase::Environment::get().getWorld()->hasCellChanged(); | ||||
| 
 | ||||
|             // local scripts
 | ||||
|             executeLocalScripts(); // This does not handle the case where a global script causes a
 | ||||
|                                     // cell change, followed by a cell change in a local script during
 | ||||
|                                     // the same frame.
 | ||||
|             executeLocalScripts(); | ||||
| 
 | ||||
|             if (changed) // keep change flag for another frame, if cell changed happened in local script
 | ||||
|             MWBase::Environment::get().getWorld()->markCellAsUnchanged(); | ||||
| 
 | ||||
|             if (!paused) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue