diff options
| author | Paul Gilbert | 2007-12-22 11:34:10 +0000 | 
|---|---|---|
| committer | Paul Gilbert | 2007-12-22 11:34:10 +0000 | 
| commit | 337db5d4c785df251f79b8778e74e6b9294c7383 (patch) | |
| tree | d67de81fe6bf4b7c2288d8fe91e4c15940db5939 | |
| parent | 9dc39c302ad21f1e6b4fa0bfce6557610446bd5d (diff) | |
| download | scummvm-rg350-337db5d4c785df251f79b8778e74e6b9294c7383.tar.gz scummvm-rg350-337db5d4c785df251f79b8778e74e6b9294c7383.tar.bz2 scummvm-rg350-337db5d4c785df251f79b8778e74e6b9294c7383.zip  | |
Bugfix to not allow animation fast forward when restoring a game - it was causing occasional crashes due to tick handlers referencing animations not yet loaded (it's only meant to be done during room changes)
svn-id: r29950
| -rw-r--r-- | engines/lure/room.cpp | 22 | 
1 files changed, 13 insertions, 9 deletions
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 5d04fea36b..450e2ea3aa 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -583,15 +583,19 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) {  	loadRoomHotspots(); -	if ((_roomData->exitTime != 0xffff) && (_roomData->exitTime != 0)) { -		// If time has passed, animation ticks needed before room is displayed -		int numSeconds = (g_system->getMillis() - _roomData->exitTime) / 1000; -		if (numSeconds > 300) numSeconds = 300; - -		game.preloadFlag() = true; -		while (numSeconds-- > 0) -			game.tick(); -		game.preloadFlag() = false; +	if (leaveFlag) { +		// A previous room has been left - check if there are any seconds worth  +		// of animations that need to be done in 'fast forward' +		if ((_roomData->exitTime != 0xffff) && (_roomData->exitTime != 0)) { +			// If time has passed, animation ticks needed before room is displayed +			int numSeconds = (g_system->getMillis() - _roomData->exitTime) / 1000; +			if (numSeconds > 300) numSeconds = 300; + +			game.preloadFlag() = true; +			while (numSeconds-- > 0) +				game.tick(); +			game.preloadFlag() = false; +		}  	}  	game.tick();  | 
