Don't count units with 0 hp for the stats (unit-revealer, unit-circle-of-power, etc)

This commit is contained in:
jsalmon3 2003-02-07 18:36:02 +00:00
parent b51d0f0bbb
commit 043ed324bd

View file

@ -381,12 +381,14 @@ global void AssignUnitToPlayer(Unit *unit, Player *player)
//
if (player && !type->Vanishes && unit->Orders[0].Action != UnitActionDie) {
unit->PlayerSlot=player->Units+player->TotalNumUnits++;
if( type->_HitPoints!=0 ) {
if( type->Building ) {
player->TotalBuildings++;
}
else {
player->TotalUnits++;
}
}
*unit->PlayerSlot=unit;
player->UnitTypesCount[type->Type]++;
@ -1696,12 +1698,14 @@ global void ChangeUnitOwner(Unit* unit,Player* oldplayer,Player* newplayer)
// Insert into new player table.
unit->PlayerSlot=newplayer->Units+newplayer->TotalNumUnits++;
if( unit->Type->_HitPoints!=0 ) {
if( unit->Type->Building ) {
newplayer->TotalBuildings++;
}
else {
newplayer->TotalUnits++;
}
}
*unit->PlayerSlot=unit;
unit->Player=newplayer;