From d1ac57fa492d9b682582312c013069c7b1df896d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 6 Feb 2016 17:27:09 -0500 Subject: MADS: Fix stop stopWalkers list incorrectly filling up --- engines/mads/nebular/game_nebular.cpp | 76 ++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 37 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 9c0acf1a47..1db5eaea00 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -827,49 +827,51 @@ void GameNebular::step() { if (_player._visible && _player._stepEnabled && !_player._moving && (_player._facing == _player._turnToFacing)) { if (_scene._frameStartTime >= (uint32)_globals[kWalkerTiming]) { - int randomVal = _vm->getRandomNumber(29999); - if (_globals[kSexOfRex] == REX_MALE) { - switch (_player._facing) { - case FACING_SOUTHWEST: - case FACING_SOUTHEAST: - case FACING_NORTHWEST: - case FACING_NORTHEAST: - if (randomVal < 200) { - _player.addWalker(-1, 0); - _player.addWalker(1, 0); - } - break; - - case FACING_WEST: - case FACING_EAST: - if (randomVal < 500) { - for (int count = 0; count < 10; ++count) { + if (_player._stopWalkers.empty()) { + int randomVal = _vm->getRandomNumber(29999); + if (_globals[kSexOfRex] == REX_MALE) { + switch (_player._facing) { + case FACING_SOUTHWEST: + case FACING_SOUTHEAST: + case FACING_NORTHWEST: + case FACING_NORTHEAST: + if (randomVal < 200) { + _player.addWalker(-1, 0); _player.addWalker(1, 0); } - } - break; - - case FACING_SOUTH: - if (randomVal < 500) { - for (int count = 0; count < 10; ++count) { - _player.addWalker((randomVal < 250) ? 1 : 2, 0); + break; + + case FACING_WEST: + case FACING_EAST: + if (randomVal < 500) { + for (int count = 0; count < 10; ++count) { + _player.addWalker(1, 0); + } } - } else if (randomVal < 750) { - for (int count = 0; count < 5; ++count) { - _player.addWalker(1, 0); + break; + + case FACING_SOUTH: + if (randomVal < 500) { + for (int count = 0; count < 10; ++count) { + _player.addWalker((randomVal < 250) ? 1 : 2, 0); + } + } else if (randomVal < 750) { + for (int count = 0; count < 5; ++count) { + _player.addWalker(1, 0); + } + + _player.addWalker(0, 0); + _player.addWalker(0, 0); + + for (int count = 0; count < 5; ++count) { + _player.addWalker(2, 0); + } } + break; - _player.addWalker(0, 0); - _player.addWalker(0, 0); - - for (int count = 0; count < 5; ++count) { - _player.addWalker(2, 0); - } + default: + break; } - break; - - default: - break; } } -- cgit v1.2.3