aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular
diff options
context:
space:
mode:
authorPaul Gilbert2016-02-06 17:27:09 -0500
committerPaul Gilbert2016-02-06 17:27:09 -0500
commitd1ac57fa492d9b682582312c013069c7b1df896d (patch)
treee07d37cf43ebfb0cbc4471d5cce74bc5708fc77d /engines/mads/nebular
parent51d415733cc7823a0fc4e1694a8671713c9f0292 (diff)
downloadscummvm-rg350-d1ac57fa492d9b682582312c013069c7b1df896d.tar.gz
scummvm-rg350-d1ac57fa492d9b682582312c013069c7b1df896d.tar.bz2
scummvm-rg350-d1ac57fa492d9b682582312c013069c7b1df896d.zip
MADS: Fix stop stopWalkers list incorrectly filling up
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r--engines/mads/nebular/game_nebular.cpp76
1 files changed, 39 insertions, 37 deletions
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;
}
}