Skip to content

Commit fda9e56

Browse files
committed
fix melee bug
1 parent 93a2caa commit fda9e56

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

src/Battlescape/BattlescapeGame.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ void BattlescapeGame::handleNonTargetAction()
622622
_parentState->warning(_currentAction.result);
623623
_currentAction.result = "";
624624
}
625-
if (_currentAction.type == BA_PRIME && _currentAction.value > -1)
625+
else if (_currentAction.type == BA_PRIME && _currentAction.value > -1)
626626
{
627627
if (_currentAction.actor->spendTimeUnits(_currentAction.TU))
628628
{
@@ -634,22 +634,19 @@ void BattlescapeGame::handleNonTargetAction()
634634
_parentState->warning("STR_NOT_ENOUGH_TIME_UNITS");
635635
}
636636
}
637-
if (_currentAction.type == BA_USE || _currentAction.type == BA_LAUNCH)
637+
else if (_currentAction.type == BA_USE || _currentAction.type == BA_LAUNCH)
638638
{
639639
_save->reviveUnconsciousUnits();
640640
}
641-
if (_currentAction.type == BA_HIT)
641+
else if (_currentAction.type == BA_HIT)
642642
{
643-
if (_currentAction.result.empty())
643+
if (_currentAction.actor->spendTimeUnits(_currentAction.TU))
644644
{
645-
if (_currentAction.actor->spendTimeUnits(_currentAction.TU))
646-
{
647-
statePushBack(new MeleeAttackBState(this, _currentAction));
648-
}
649-
else
650-
{
651-
_parentState->warning("STR_NOT_ENOUGH_TIME_UNITS");
652-
}
645+
statePushBack(new MeleeAttackBState(this, _currentAction));
646+
}
647+
else
648+
{
649+
_parentState->warning("STR_NOT_ENOUGH_TIME_UNITS");
653650
}
654651
}
655652
_currentAction.type = BA_NONE;

0 commit comments

Comments
 (0)