Skip to content

Commit

Permalink
fix up small melee bug
Browse files Browse the repository at this point in the history
don't award Exp for firing when we're not firing
  • Loading branch information
Warboy1982 committed Mar 27, 2020
1 parent 4d6f686 commit 80eb064
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Battlescape/BattlescapeGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ void BattlescapeGame::handleNonTargetAction()
_parentState->warning("STR_NOT_ENOUGH_TIME_UNITS");
}
}
else if (_currentAction.type == BA_USE || _currentAction.type == BA_LAUNCH)
else if (_currentAction.type == BA_USE)
{
_save->reviveUnconsciousUnits();
}
Expand All @@ -853,7 +853,10 @@ void BattlescapeGame::handleNonTargetAction()
_parentState->warning("STR_NOT_ENOUGH_TIME_UNITS");
}
}
_currentAction.type = BA_NONE;
if (_currentAction.type != BA_HIT) // don't clear the action type if we're meleeing, let the melee action state take care of that
{
_currentAction.type = BA_NONE;
}
_parentState->updateSoldierInfo();
}

Expand Down Expand Up @@ -884,7 +887,7 @@ void BattlescapeGame::setupCursor()
getMap()->setCursorType(CT_AIM);
}
}
else
else if (_currentAction.type != BA_HIT)
{
_currentAction.actor = _save->getSelectedUnit();
if (_currentAction.actor)
Expand Down
2 changes: 2 additions & 0 deletions src/Battlescape/MeleeAttackBState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ void MeleeAttackBState::think()
// _parent->getTileEngine()->checkReactionFire(_unit);
// }

_parent->getSave()->getBattleGame()->getCurrentAction()->type = BA_NONE; // do this to restore cursor

if (_parent->getSave()->getSide() == FACTION_PLAYER || _parent->getSave()->getDebugMode())
{
_parent->setupCursor();
Expand Down

0 comments on commit 80eb064

Please sign in to comment.