I've been looking at the Angel's Cross after Meridian's LP showed a soldier was awarded this from reviving an alien. The description of the medal that it is for reviving a fellow soldier.
I looked in the code (MedikitState.cpp) and saw this:
if (!_revivedTarget)
{
_targetUnit->setTimeUnits(0);
_action->actor->getStatistics()->revivedSoldier++;
_revivedTarget = true;
}
This makes sense with what we saw. It's just keeping track of revives of anything even though the variable says revived
SoldierNow, I could do it this way:
if (!_revivedTarget)
{
_targetUnit->setTimeUnits(0);
if(_targetUnit->getOriginalFaction() == FACTION_PLAYER)
{
_action->actor->getStatistics()->revivedSoldier++;
}
_revivedTarget = true;
}
But I ran into a problem, when I saw the comments around "revivedSoldier".
int revivedSoldier; ///< Tracks how many times this soldier revived another unit
Sounds like this variable should be called "revivedUnit" instead of "revivedSoldier". Which is stored in a save file under revivedUnitTotal:
_revivedUnitTotal += unitStatistics->revivedSoldier
Confusing right?
I'm not sure how to proceed with fixing this issue with Angel's Cross.
I could add a new stat that really is for reviving soldiers and renamed revivedSoldier to revivedUnit. I'm not sure how open the devs will be to adding more statistics.
Then the code becomes this:
if (!_revivedTarget)
{
_targetUnit->setTimeUnits(0);
if(_targetUnit->getOriginalFaction() == FACTION_PLAYER)
{
_action->actor->getStatistics()->revivedSoldier++;
}
_action->actor->getStatiistics()->revivedUnit++;
_revivedTarget = true;
}
While I'm at, I could add reviving citizens and aliens to boot, but that might be going overboard
Or the award could be renamed to just include anybody and no code changes?
Thoughts? Suggestions?