Skip to content

Commit

Permalink
DM: Get rid of a GOTO in projectileGetImpactCount
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Sep 7, 2016
1 parent 6df9a20 commit 8f33b46
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions engines/dm/projexpl.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8f33b46

Please sign in to comment.