Skip to content

Commit

Permalink
DM: Reduce scope of a couple of variables, simplify a couple of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and Bendegúz Nagy committed Aug 26, 2016
1 parent f00f5c1 commit d770ec0
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions engines/dm/eventman.cpp
Expand Up @@ -520,19 +520,14 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
ChampionMan &champMan = *_vm->_championMan;
CurrMapData &currMap = _vm->_dungeonMan->_currMap;

int16 mapX;
int16 mapY;

if (dunMan._squareAheadElement == kElementTypeDoorFront) {
if (champMan._leaderIndex == kChampionNone) {
if (champMan._leaderIndex == kChampionNone)
return;
}
mapX = currMap._partyPosX;
mapY = currMap._partyPosY;
mapX += gDirIntoStepCountEast[currMap._partyDir];
mapY += gDirIntoStepCountNorth[currMap._partyDir];

if (champMan._leaderEmptyHanded) {
int16 mapX = currMap._partyPosX + gDirIntoStepCountEast[currMap._partyDir];
int16 mapY = currMap._partyPosY + gDirIntoStepCountNorth[currMap._partyDir];

if (Door(dunMan.getSquareFirstThingData(mapX, mapY)).hasButton() &&
dunMan._dungeonViewClickableBoxes[kViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) {
_vm->_stopWaitingForPlayerInput = true;
Expand Down Expand Up @@ -590,7 +585,6 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
commandProcessType80ClickInDungeonViewTouchFrontWall();
}
}

} else {
warning("MISSING CODE: F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown in if branch");
for (int16 viewCell = kViewCellFronLeft; viewCell <= kViewCellBackLeft; viewCell++) {
Expand Down Expand Up @@ -633,11 +627,9 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
}

champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kChampionNone);
int16 mapX = currMap._partyPosX;
int16 mapY = currMap._partyPosY;
int16 mapX = currMap._partyPosX + gDirIntoStepCountEast[currMap._partyDir];
int16 mapY = currMap._partyPosY + gDirIntoStepCountNorth[currMap._partyDir];

mapX += gDirIntoStepCountEast[currMap._partyDir];
mapY += gDirIntoStepCountNorth[currMap._partyDir];
for (uint16 slotIndex = kChampionSlotReadyHand; slotIndex < kChampionSlotChest_1; slotIndex++) {
Thing thing = champ->getSlot((ChampionSlot)slotIndex);
if (thing != Thing::_thingNone) {
Expand Down

0 comments on commit d770ec0

Please sign in to comment.