From 51329c0dc6ee56d8b843f058aa3257ec9f30b71a Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 8 Nov 2017 16:46:05 -0600 Subject: ALL: Fix misuse of comma operator --- engines/dm/champion.cpp | 3 ++- engines/dm/dm.cpp | 3 ++- engines/dm/eventman.cpp | 9 ++++++--- engines/dm/group.cpp | 12 ++++++++---- engines/dm/menus.cpp | 3 ++- engines/dm/movesens.cpp | 3 ++- engines/dm/projexpl.cpp | 3 ++- 7 files changed, 24 insertions(+), 12 deletions(-) (limited to 'engines/dm') diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 646e7cec8d..5c08acdc84 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -2015,7 +2015,8 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { int16 curMapX = dungeon._partyMapX; int16 curMapY = dungeon._partyMapY; uint16 championObjectsCell = _vm->returnOppositeDir(dungeon._partyDir); - curMapX += _vm->_dirIntoStepCountEast[dungeon._partyDir], curMapY += _vm->_dirIntoStepCountNorth[dungeon._partyDir]; + curMapX += _vm->_dirIntoStepCountEast[dungeon._partyDir]; + curMapY += _vm->_dirIntoStepCountNorth[dungeon._partyDir]; curThing = dungeon.getSquareFirstThing(curMapX, curMapY); int16 slotIdx = kDMSlotBackpackLine1_1; while (curThing != _vm->_thingEndOfList) { diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 4c19ab01df..29ba665a47 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -922,7 +922,8 @@ void DMEngine::fuseSequence() { fuseSequenceUpdate(); int16 lordChaosMapX = _dungeonMan->_partyMapX; int16 lordChaosMapY = _dungeonMan->_partyMapY; - lordChaosMapX += _dirIntoStepCountEast[_dungeonMan->_partyDir], lordChaosMapY += _dirIntoStepCountNorth[_dungeonMan->_partyDir]; + lordChaosMapX += _dirIntoStepCountEast[_dungeonMan->_partyDir]; + lordChaosMapY += _dirIntoStepCountNorth[_dungeonMan->_partyDir]; Thing lordChaosThing = _groupMan->groupGetThing(lordChaosMapX, lordChaosMapY); Group *lordGroup = (Group*)_dungeonMan->getThingData(lordChaosThing); lordGroup->_health[0] = 10000; diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 3859fc90b2..f424672b67 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -1369,7 +1369,8 @@ void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16 int16 mapX = _vm->_dungeonMan->_partyMapX; int16 mapY = _vm->_dungeonMan->_partyMapY; if (viewCell >= kDMViewCellBackRight) { - mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; + mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; + mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY); if ((groupThing != _vm->_thingEndOfList) && !_vm->_moveSens->isLevitating(groupThing) && @@ -1397,8 +1398,10 @@ void EventManager::clickInDungeonViewDropLeaderHandObject(uint16 viewCell) { if (droppingIntoAnAlcove) viewCell = kDMViewCellBackRight; - if (viewCell > kDMViewCellFrontRight) - mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; + if (viewCell > kDMViewCellFrontRight) { + mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; + mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; + } uint16 currCell = _vm->normalizeModulo4(_vm->_dungeonMan->_partyDir + viewCell); Thing removedThing = _vm->_championMan->getObjectRemovedFromLeaderHand(); diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 9bfeb1da1d..dfdcdc017f 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -819,7 +819,8 @@ T0209058_MoveInRandomDirection: do { AL0450_i_DestinationMapX = eventMapX; AL0451_i_DestinationMapY = eventMapY; - AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction], AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction]; + AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction]; + AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction]; if (((activeGroup->_priorMapX != AL0450_i_DestinationMapX) || (activeGroup->_priorMapY != AL0451_i_DestinationMapY) || (moveToPriorLocation = !_vm->getRandomNumber(4))) /* 1/4 chance of moving back to the square that the creature comes from */ @@ -910,7 +911,8 @@ T0209085_SingleSquareMove: (!_vm->getRandomNumber(4) && isMovementPossible(&creatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->returnOppositeDir((Direction)primaryDirectionToOrFromParty), false))) { AL0450_i_DestinationMapX = eventMapX; AL0451_i_DestinationMapY = eventMapY; - AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction], AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction]; + AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction]; + AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction]; goto T0209061_MoveGroup; } if (isArchEnemy) { @@ -922,7 +924,8 @@ T0209089_DoubleSquareMove: ((_fluxCageCount >= 2) && isArchenemyDoubleMovementPossible(&creatureInfo, eventMapX, eventMapY, AL0446_i_Direction = _vm->returnOppositeDir((Direction)primaryDirectionToOrFromParty)))) { AL0450_i_DestinationMapX = eventMapX; AL0451_i_DestinationMapY = eventMapY; - AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction] * 2, AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction] * 2; + AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction] * 2; + AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction] * 2; _vm->_sound->requestPlay(kDMSoundIndexBuzz, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, kDMSoundModePlayIfPrioritized); goto T0209061_MoveGroup; } @@ -1451,7 +1454,8 @@ bool GroupMan::isArchenemyDoubleMovementPossible(CreatureInfo *info, int16 mapX, if (_fluxCages[dir]) return false; - mapX += _vm->_dirIntoStepCountEast[dir], mapY += _vm->_dirIntoStepCountNorth[dir]; + mapX += _vm->_dirIntoStepCountEast[dir]; + mapY += _vm->_dirIntoStepCountNorth[dir]; return isMovementPossible(info, mapX, mapY, dir, false); } diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 9c8e219851..1600f589e9 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -1263,7 +1263,8 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { setChampionDirectionToPartyDirection(curChampion); nextMapX = dungeon._partyMapX; nextMapY = dungeon._partyMapY; - nextMapX += _vm->_dirIntoStepCountEast[dungeon._partyDir], nextMapY += _vm->_dirIntoStepCountNorth[dungeon._partyDir]; + nextMapX += _vm->_dirIntoStepCountEast[dungeon._partyDir]; + nextMapY += _vm->_dirIntoStepCountNorth[dungeon._partyDir]; _vm->_groupMan->fuseAction(nextMapX, nextMapY); break; case kDMActionHeal: { diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index 410ede740a..1dc36f7979 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -352,7 +352,8 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM dungeon.setCurrentMap(mapIndexDestination); } direction = dungeon.getStairsExitDirection(destMapX, destMapY); - destMapX += _vm->_dirIntoStepCountEast[direction], destMapY += _vm->_dirIntoStepCountNorth[direction]; + destMapX += _vm->_dirIntoStepCountEast[direction]; + destMapY += _vm->_dirIntoStepCountNorth[direction]; direction = _vm->returnOppositeDir((Direction)direction); thingCell = thing.getCell(); thingCell = _vm->normalizeModulo4((((thingCell - direction + 1) & 0x0002) >> 1) + direction); diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp index 85767cd633..e8b0f4a143 100644 --- a/engines/dm/projexpl.cpp +++ b/engines/dm/projexpl.cpp @@ -429,7 +429,8 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) { if (projectileMovesToOtherSquare) { sourceMapX = destinationMapX; sourceMapY = destinationMapY; - destinationMapX += _vm->_dirIntoStepCountEast[projectileDirection], destinationMapY += _vm->_dirIntoStepCountNorth[projectileDirection]; + destinationMapX += _vm->_dirIntoStepCountEast[projectileDirection]; + destinationMapY += _vm->_dirIntoStepCountNorth[projectileDirection]; Square destSquare = _vm->_dungeonMan->getSquare(destinationMapX, destinationMapY); ElementType destSquareType = destSquare.getType(); if ((destSquareType == kDMElementTypeWall) || -- cgit v1.2.3