Skip to content

Commit

Permalink
moved reactivation
Browse files Browse the repository at this point in the history
Only reactivate a soldier in findItem when we actually did something.
  • Loading branch information
Xilmi committed Jun 30, 2024
1 parent 0271aae commit a201bbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Battlescape/BattlescapeGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2631,8 +2631,6 @@ Mod *BattlescapeGame::getMod()
*/
bool BattlescapeGame::findItem(BattleAction *action, bool pickUpWeaponsMoreActively, bool& walkToItem)
{
// since we overrule what the AI wanted, we must allow more turns
action->actor->setWantToEndTurn(false);
// terrorists don't have hands.
if (action->actor->getRankString() != "STR_LIVE_TERRORIST" || pickUpWeaponsMoreActively)
{
Expand Down Expand Up @@ -2665,6 +2663,8 @@ bool BattlescapeGame::findItem(BattleAction *action, bool pickUpWeaponsMoreActiv
// try to pick it up
if (takeItemFromGround(targetItem, action) == 0)
{
// since we overrule what the AI wanted, we must allow more turns
action->actor->setWantToEndTurn(false);
// if it isn't loaded or it is ammo
if (!targetItem->haveAnyAmmo())
{
Expand All @@ -2685,6 +2685,8 @@ bool BattlescapeGame::findItem(BattleAction *action, bool pickUpWeaponsMoreActiv
action->target = targetItem->getTile()->getPosition();
action->type = BA_WALK;
walkToItem = true;
// since we overrule what the AI wanted, we must allow more turns
action->actor->setWantToEndTurn(false);
if (pickUpWeaponsMoreActively)
{
// don't end the turn after walking 1-2 tiles... pick up a weapon and shoot!
Expand Down

0 comments on commit a201bbe

Please sign in to comment.