Permalink
Browse files

Merge pull request #1179 from jgatkinsn/commendation_fixes

fix bug where mercy or nike cross is erroneously awarded for instance…
  • Loading branch information...
SupSuper committed Apr 10, 2018
2 parents 245ce6a + e8791f9 commit 80d8e9ff45fd70a099efbefec475b2ac148b214d
Showing with 5 additions and 4 deletions.
  1. +4 −3 src/Battlescape/DebriefingState.cpp
  2. +1 −1 src/Savegame/BattleUnitStatistics.h
@@ -423,7 +423,7 @@ DebriefingState::DebriefingState() : _region(0), _country(0), _positiveScore(tru
SoldierRank rank = (*deadUnit)->getGeoscapeSoldier()->getRank();
// Rookies don't get this next award. No one likes them.
if (rank == 0)
if (rank == RANK_ROOKIE)
{
continue;
}
@@ -486,11 +486,12 @@ DebriefingState::DebriefingState() : _region(0), _country(0), _positiveScore(tru
soldierAlienStuns++;
}
}
if (aliensKilled && aliensKilled == soldierAlienKills && _missionStatistics->success == true)
if (aliensKilled != 0 && aliensKilled == soldierAlienKills && _missionStatistics->success == true && aliensStunned == soldierAlienStuns)
{
(*j)->getStatistics()->nikeCross = true;
}
if (aliensStunned && aliensStunned == soldierAlienStuns && _missionStatistics->success == true)
if (aliensStunned != 0 && aliensStunned == soldierAlienStuns && _missionStatistics->success == true && aliensKilled == 0)
{
(*j)->getStatistics()->mercyCross = true;
}
@@ -318,7 +318,7 @@ struct BattleUnitStatistics
std::vector<BattleUnitKills*> kills; ///< Tracks kills
int daysWounded; ///< Tracks how many days the unit was wounded for
bool KIA; ///< Tracks if the soldier was killed in battle
bool nikeCross; ///< Tracks if a soldier killed every alien
bool nikeCross; ///< Tracks if a soldier killed every alien or killed and stunned every alien
bool mercyCross; ///< Tracks if a soldier stunned every alien
int woundsHealed; ///< Tracks how many times a fatal wound was healed by this unit
UnitStats delta; ///< Tracks the increase in unit stats (is not saved, only used during debriefing)

0 comments on commit 80d8e9f

Please sign in to comment.