diff options
author | Strangerke | 2016-09-11 10:45:20 +0200 |
---|---|---|
committer | Strangerke | 2016-09-11 10:45:20 +0200 |
commit | b17f3490f84bb7342d240f31e884984c38110425 (patch) | |
tree | c17f99e46b7dc922e5a193951c0166fa8c4fba4f /engines/dm/timeline.cpp | |
parent | f0a6f6b269fb121affa252e36d23c895c7d32e4e (diff) | |
download | scummvm-rg350-b17f3490f84bb7342d240f31e884984c38110425.tar.gz scummvm-rg350-b17f3490f84bb7342d240f31e884984c38110425.tar.bz2 scummvm-rg350-b17f3490f84bb7342d240f31e884984c38110425.zip |
DM: Rework functions related to Directions in order to make them consistent and remove redundancy
Diffstat (limited to 'engines/dm/timeline.cpp')
-rw-r--r-- | engines/dm/timeline.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 308f58f106..1b375bc3d0 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -656,7 +656,7 @@ void Timeline::triggerProjectileLauncher(Sensor *sensor, TimelineEvent *event) { firstProjectileAssociatedThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while (firstProjectileAssociatedThing != Thing::_none) { /* BUG0_19 The game crashes when an object launcher sensor is triggered. Thing::_none should be Thing::_endOfList. If there are no more objects on the square then this loop may return an undefined value, this can crash the game. In the original DM and CSB dungeons, the number of times that these sensors are triggered is always controlled to be equal to the number of available objects (with a countdown sensor or a number of once only sensors) */ uint16 projectiveThingCell = firstProjectileAssociatedThing.getCell(); - if ((firstProjectileAssociatedThing.getType() > kDMThingTypeSensor) && ((projectiveThingCell == cell) || (projectiveThingCell == _vm->returnNextVal(cell)))) + if ((firstProjectileAssociatedThing.getType() > kDMThingTypeSensor) && ((projectiveThingCell == cell) || (projectiveThingCell == _vm->turnDirRight(cell)))) break; firstProjectileAssociatedThing = _vm->_dungeonMan->getNextThing(firstProjectileAssociatedThing); } @@ -668,7 +668,7 @@ void Timeline::triggerProjectileLauncher(Sensor *sensor, TimelineEvent *event) { secondProjectileAssociatedThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); while (secondProjectileAssociatedThing != Thing::_none) { /* BUG0_19 The game crashes when an object launcher sensor is triggered. Thing::_none should be Thing::_endOfList. If there are no more objects on the square then this loop may return an undefined value, this can crash the game */ uint16 projectiveThingCell = secondProjectileAssociatedThing.getCell(); - if ((secondProjectileAssociatedThing.getType() > kDMThingTypeSensor) && ((projectiveThingCell == cell) || (projectiveThingCell == _vm->returnNextVal(cell)))) + if ((secondProjectileAssociatedThing.getType() > kDMThingTypeSensor) && ((projectiveThingCell == cell) || (projectiveThingCell == _vm->turnDirRight(cell)))) break; secondProjectileAssociatedThing = _vm->_dungeonMan->getNextThing(secondProjectileAssociatedThing); } @@ -695,7 +695,7 @@ void Timeline::triggerProjectileLauncher(Sensor *sensor, TimelineEvent *event) { _vm->_projexpl->_createLauncherProjectile = true; _vm->_projexpl->createProjectile(firstProjectileAssociatedThing, mapX, mapY, projectileCell, (Direction)cell, kineticEnergy, 100, stepEnergy); if (!launchSingleProjectile) - _vm->_projexpl->createProjectile(secondProjectileAssociatedThing, mapX, mapY, _vm->returnNextVal(projectileCell), (Direction)cell, kineticEnergy, 100, stepEnergy); + _vm->_projexpl->createProjectile(secondProjectileAssociatedThing, mapX, mapY, _vm->turnDirRight(projectileCell), (Direction)cell, kineticEnergy, 100, stepEnergy); _vm->_projexpl->_createLauncherProjectile = false; } |