aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-06-27 22:01:40 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitd770ec0f61a8fea8a2e276be6c6b841dab01bae2 (patch)
treebb54cec56d1946e0cfc5c68c6918fea049fa3654
parentf00f5c19e73204ba44ed508871bb50d348e62a5b (diff)
downloadscummvm-rg350-d770ec0f61a8fea8a2e276be6c6b841dab01bae2.tar.gz
scummvm-rg350-d770ec0f61a8fea8a2e276be6c6b841dab01bae2.tar.bz2
scummvm-rg350-d770ec0f61a8fea8a2e276be6c6b841dab01bae2.zip
DM: Reduce scope of a couple of variables, simplify a couple of lines
-rw-r--r--engines/dm/eventman.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 6d39a12ef8..96cda36747 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -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;
@@ -590,7 +585,6 @@ T0377019:
commandProcessType80ClickInDungeonViewTouchFrontWall();
}
}
-
} else {
warning("MISSING CODE: F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown in if branch");
for (int16 viewCell = kViewCellFronLeft; viewCell <= kViewCellBackLeft; viewCell++) {
@@ -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) {