From 9297e62aed73f313f932276f392e68e17cfc04b6 Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Sat, 21 Nov 2009 18:18:09 +0000 Subject: Fixed re-entering the same room using a different gate svn-id: r46044 --- engines/draci/game.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 5e124892df..a170cc2948 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -432,7 +432,7 @@ void Game::advanceAnimationsAndTestLoopExit() { // A script has scheduled changing the room (either triggered // by the user clicking on something or run at the end of a // gate script in the intro). - if ((_loopStatus == kStatusOrdinary || _loopStatus == kStatusGate) && _newRoom != getRoomNum()) { + if ((_loopStatus == kStatusOrdinary || _loopStatus == kStatusGate) && (_newRoom != getRoomNum() || _newGate != _variables[0] - 1)) { setExitLoop(true); } @@ -1161,7 +1161,14 @@ void Game::deleteObjectAnimations() { } bool Game::enterNewRoom() { - if (_newRoom == getRoomNum() && !isReloaded()) { + if ((_newRoom == getRoomNum() && _newGate == _variables[0] - 1) && !isReloaded()) { + // Re-entering the same room via a different gate is correct + // and the room needs to be reloaded (used in the ballroom when + // propping the chair by the brick). + // TODO: 1. don't use _variables but a new named attribute. 2. + // investigate whether the optimization with shortcut is + // needed; maybe reloading the room always is the right thing + // to do. _vm->_script->endCurrentProgram(false); return true; } -- cgit v1.2.3