Skip to content

Commit

Permalink
DM: Fix typo in the name of isObjectInPartyPossession, get rid of the…
Browse files Browse the repository at this point in the history
… GOTO
  • Loading branch information
Strangerke committed Sep 4, 2016
1 parent 91fe537 commit 4774174
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions engines/dm/movesens.cpp
Expand Up @@ -809,7 +809,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
case k8_SensorFloorPartyPossession:
if (thingType != kM1_PartyThingType)
goto T0276079;
triggerSensor = isObjcetInPartyPossession(curSensorData);
triggerSensor = isObjectInPartyPossession(curSensorData);
break;
case k9_SensorFloorVersionChecker:
if ((thingType != kM1_PartyThingType) || !addThing || partySquare)
Expand Down Expand Up @@ -861,7 +861,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
processRotationEffect();
}

bool MovesensMan::isObjcetInPartyPossession(int16 objectType) {
bool MovesensMan::isObjectInPartyPossession(int16 objectType) {
bool leaderHandObjectProcessed = false;
Champion *curChampion = _vm->_championMan->_champions;
int16 championIdx;
Expand All @@ -871,14 +871,19 @@ bool MovesensMan::isObjcetInPartyPossession(int16 objectType) {
for (championIdx = k0_ChampionFirst; championIdx < _vm->_championMan->_partyChampionCount; championIdx++, curChampion++) {
if (curChampion->_currHealth) {
curSlotThing = curChampion->_slots;
for (slotIdx = k0_ChampionSlotReadyHand; (slotIdx < k30_ChampionSlotChest_1) && !leaderHandObjectProcessed; slotIdx++) {
curThing = *curSlotThing++;
T0274003:
int16 objectType = _vm->_objectMan->getObjectType(curThing);
if (objectType == objectType)
for (slotIdx = k0_ChampionSlotReadyHand; (slotIdx < k30_ChampionSlotChest_1) || !leaderHandObjectProcessed; slotIdx++) {
if (slotIdx < k30_ChampionSlotChest_1)
curThing = *curSlotThing++;
else {
leaderHandObjectProcessed = true;
curThing = _vm->_championMan->_leaderHandObject;
}

int16 curObjectType = _vm->_objectMan->getObjectType(curThing);
if (curObjectType == objectType)
return true;

if (objectType == k144_IconIndiceContainerChestClosed) {
if (curObjectType == k144_IconIndiceContainerChestClosed) {
Container *container = (Container *)_vm->_dungeonMan->getThingData(curThing);
curThing = container->getSlot();
while (curThing != Thing::_endOfList) {
Expand All @@ -891,11 +896,6 @@ bool MovesensMan::isObjcetInPartyPossession(int16 objectType) {
}
}
}
if (!leaderHandObjectProcessed) {
leaderHandObjectProcessed = true;
curThing = _vm->_championMan->_leaderHandObject;
goto T0274003;
}
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/dm/movesens.h
Expand Up @@ -60,7 +60,7 @@ namespace DM {
int16 getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing thing, uint16 mapIndex);// @ F0262_MOVE_GetTeleporterRotatedGroupResult
Thing getTeleporterRotatedProjectileThing(Teleporter *teleporter, Thing projectileThing); // @ F0263_MOVE_GetTeleporterRotatedProjectileThing
void processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing thing, bool partySquare, bool addThing);// @ F0276_SENSOR_ProcessThingAdditionOrRemoval
bool isObjcetInPartyPossession(int16 objectType); // @ F0274_SENSOR_IsObjectInPartyPossession
bool isObjectInPartyPossession(int16 objectType); // @ F0274_SENSOR_IsObjectInPartyPossession
void triggerEffect(Sensor *sensor, int16 effect, int16 mapX, int16 mapY, uint16 cell); // @ F0272_SENSOR_TriggerEffect
void triggerLocalEffect(int16 localEffect, int16 effX, int16 effY, int16 effCell); // @ F0270_SENSOR_TriggerLocalEffect
void addSkillExperience(int16 skillIndex, uint16 exp, bool leaderOnly); // @ F0269_SENSOR_AddSkillExperience
Expand Down

0 comments on commit 4774174

Please sign in to comment.