aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2007-12-22 11:34:10 +0000
committerPaul Gilbert2007-12-22 11:34:10 +0000
commit337db5d4c785df251f79b8778e74e6b9294c7383 (patch)
treed67de81fe6bf4b7c2288d8fe91e4c15940db5939
parent9dc39c302ad21f1e6b4fa0bfce6557610446bd5d (diff)
downloadscummvm-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.cpp22
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();