Don't count units with 0 hp for the stats (unit-revealer, unit-circle-of-power, etc)
This commit is contained in:
parent
b51d0f0bbb
commit
043ed324bd
1 changed files with 14 additions and 10 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue