aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-08-07 23:33:36 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit2b1b784479709a9cdd596200c280617537739bb9 (patch)
tree6228f53ee4dc0def6aae6a28194a7640a031ed75
parentc57929d3da42fd490911de67c3d4f58f38c08755 (diff)
downloadscummvm-rg350-2b1b784479709a9cdd596200c280617537739bb9.tar.gz
scummvm-rg350-2b1b784479709a9cdd596200c280617537739bb9.tar.bz2
scummvm-rg350-2b1b784479709a9cdd596200c280617537739bb9.zip
DM: Remove GOTOs in f164_unlinkThingFromList
-rw-r--r--engines/dm/dungeonman.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 87bd66fe6c..4e27eb581a 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1529,15 +1529,12 @@ void DungeonMan::f164_unlinkThingFromList(Thing thingToUnlink, Thing thingInList
#define AL0275_pui_CumulativeFirstThingCount L0275_pui_Multiple
- if (thingToUnlink == Thing::_endOfList) {
+ if (thingToUnlink == Thing::_endOfList)
return;
- }
- {
- uint16 tmp = thingToUnlink.toUint16();
- clearFlag(tmp, 0xC000);
- thingToUnlink = Thing(tmp);
- }
+ uint16 tmp = thingToUnlink.toUint16();
+ clearFlag(tmp, 0xC000);
+ thingToUnlink = Thing(tmp);
if (mapX >= 0) {
L0274_ps_Generic = (Thing*)_vm->_dungeonMan->f156_getThingData(thingToUnlink);
@@ -1554,25 +1551,27 @@ void DungeonMan::f164_unlinkThingFromList(Thing thingToUnlink, Thing thingInList
while (AL0272_ui_Column--) { /* For each column starting from and after the column containing the square where the thing is unlinked */
(*(uint16*)AL0275_pui_CumulativeFirstThingCount++)--; /* Decrement the cumulative first thing count */
}
- goto T0164011;
+ *L0274_ps_Generic = Thing::_endOfList;
+ return;
}
if (((Thing*)AL0275_pT_Thing)->getTypeAndIndex() == thingToUnlink.toUint16()) {
*AL0275_pT_Thing = *L0274_ps_Generic;
- goto T0164011;
+ *L0274_ps_Generic = Thing::_endOfList;
+ return;
}
thingInList = *AL0275_pT_Thing;
}
L0273_T_Thing = _vm->_dungeonMan->f159_getNextThing(thingInList);
while (L0273_T_Thing.getTypeAndIndex() != thingToUnlink.toUint16()) {
if ((L0273_T_Thing == Thing::_endOfList) || (L0273_T_Thing == Thing::_none)) {
- goto T0164011;
+ *L0274_ps_Generic = Thing::_endOfList;
+ return;
}
L0273_T_Thing = _vm->_dungeonMan->f159_getNextThing(thingInList = L0273_T_Thing);
}
L0274_ps_Generic = (Thing*)_vm->_dungeonMan->f156_getThingData(thingInList);
*L0274_ps_Generic = _vm->_dungeonMan->f159_getNextThing(L0273_T_Thing);
L0274_ps_Generic = (Thing*)_vm->_dungeonMan->f156_getThingData(thingToUnlink);
-T0164011:
*L0274_ps_Generic = Thing::_endOfList;
}