aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
authorStrangerke2016-09-07 07:14:50 +0200
committerStrangerke2016-09-07 07:14:50 +0200
commit8f33b469bef763e6603afe6b9818e2c3eee6999c (patch)
tree8e772760839c8a73c577ea883a232af23c3b0550 /engines/dm
parent6df9a20b8549196e20a79b6972edb338b1b22110 (diff)
downloadscummvm-rg350-8f33b469bef763e6603afe6b9818e2c3eee6999c.tar.gz
scummvm-rg350-8f33b469bef763e6603afe6b9818e2c3eee6999c.tar.bz2
scummvm-rg350-8f33b469bef763e6603afe6b9818e2c3eee6999c.zip
DM: Get rid of a GOTO in projectileGetImpactCount
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/projexpl.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index c87a4fba8a..f5c0a71377 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -350,19 +350,18 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
int16 ProjExpl::projectileGetImpactCount(int16 impactType, int16 mapX, int16 mapY, int16 cell) {
int16 impactCount = 0;
_creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup;
-T0218001:
- Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
- while (curThing != Thing::_endOfList) {
- if (((curThing).getType() == k14_ProjectileThingType) &&
- ((curThing).getCell() == cell) &&
+
+ for (Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); curThing != Thing::_endOfList; ) {
+ if (((curThing).getType() == k14_ProjectileThingType) && ((curThing).getCell() == cell) &&
hasProjectileImpactOccurred(impactType, mapX, mapY, cell, curThing)) {
projectileDeleteEvent(curThing);
impactCount++;
if ((impactType == kM1_CreatureElemType) && (_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup))
break;
- goto T0218001;
- }
- curThing = _vm->_dungeonMan->getNextThing(curThing);
+
+ Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
+ } else
+ curThing = _vm->_dungeonMan->getNextThing(curThing);
}
return impactCount;
}