mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
fix tactical turncoat activation reducing enemy soldier count twice
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9366 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3316,19 +3316,28 @@ bool RemoveOneTurncoat( INT16 sSectorX, INT16 sSectorY, UINT8 aSoldierClass, BOO
|
||||
case SOLDIER_CLASS_ADMINISTRATOR:
|
||||
pSector->ubNumAdmins_Turncoat--;
|
||||
if (alsoRemoveFromGroup)
|
||||
{
|
||||
pSector->ubNumAdmins--;
|
||||
pSector->ubAdminsInBattle -= (pSector->ubAdminsInBattle == 0 ? 0 : 1);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
case SOLDIER_CLASS_ARMY:
|
||||
pSector->ubNumTroops_Turncoat--;
|
||||
if (alsoRemoveFromGroup)
|
||||
{
|
||||
pSector->ubNumTroops--;
|
||||
pSector->ubTroopsInBattle -= (pSector->ubTroopsInBattle == 0 ? 0 : 1);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
case SOLDIER_CLASS_ELITE:
|
||||
pSector->ubNumElites_Turncoat--;
|
||||
if (alsoRemoveFromGroup)
|
||||
{
|
||||
pSector->ubNumElites--;
|
||||
pSector->ubElitesInBattle -= (pSector->ubElitesInBattle == 0 ? 0 : 1);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
@@ -3351,6 +3360,7 @@ bool RemoveOneTurncoat( INT16 sSectorX, INT16 sSectorY, UINT8 aSoldierClass, BOO
|
||||
if (alsoRemoveFromGroup)
|
||||
{
|
||||
pGroup->pEnemyGroup->ubNumAdmins--;
|
||||
pGroup->pEnemyGroup->ubAdminsInBattle -= (pGroup->pEnemyGroup->ubAdminsInBattle == 0 ? 0 : 1);
|
||||
pGroup->ubGroupSize--;
|
||||
}
|
||||
return true;
|
||||
@@ -3363,6 +3373,7 @@ bool RemoveOneTurncoat( INT16 sSectorX, INT16 sSectorY, UINT8 aSoldierClass, BOO
|
||||
if (alsoRemoveFromGroup)
|
||||
{
|
||||
pGroup->pEnemyGroup->ubNumTroops--;
|
||||
pGroup->pEnemyGroup->ubTroopsInBattle -= (pGroup->pEnemyGroup->ubTroopsInBattle == 0 ? 0 : 1);
|
||||
pGroup->ubGroupSize--;
|
||||
}
|
||||
return true;
|
||||
@@ -3375,6 +3386,7 @@ bool RemoveOneTurncoat( INT16 sSectorX, INT16 sSectorY, UINT8 aSoldierClass, BOO
|
||||
if (alsoRemoveFromGroup)
|
||||
{
|
||||
pGroup->pEnemyGroup->ubNumElites--;
|
||||
pGroup->pEnemyGroup->ubElitesInBattle -= (pGroup->pEnemyGroup->ubElitesInBattle == 0 ? 0 : 1);
|
||||
pGroup->ubGroupSize--;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -4487,23 +4487,14 @@ void MakeCivHostile(SOLDIERTYPE *pSoldier)
|
||||
if ( oldclass == SOLDIER_CLASS_ARMY )
|
||||
{
|
||||
pSoldier->ubSoldierClass = SOLDIER_CLASS_REG_MILITIA;
|
||||
|
||||
SectorInfo[sector].ubNumTroops = max( 0, SectorInfo[sector].ubNumTroops - 1 );
|
||||
SectorInfo[sector].ubTroopsInBattle = max( 0, SectorInfo[sector].ubTroopsInBattle - 1 );
|
||||
}
|
||||
else if ( oldclass == SOLDIER_CLASS_ELITE )
|
||||
{
|
||||
pSoldier->ubSoldierClass = SOLDIER_CLASS_ELITE_MILITIA;
|
||||
|
||||
SectorInfo[sector].ubNumElites = max( 0, SectorInfo[sector].ubNumElites - 1 );
|
||||
SectorInfo[sector].ubElitesInBattle = max( 0, SectorInfo[sector].ubElitesInBattle - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->ubSoldierClass = SOLDIER_CLASS_GREEN_MILITIA;
|
||||
|
||||
SectorInfo[sector].ubNumAdmins = max( 0, SectorInfo[sector].ubNumAdmins - 1 );
|
||||
SectorInfo[sector].ubAdminsInBattle = max( 0, SectorInfo[sector].ubAdminsInBattle - 1 );
|
||||
}
|
||||
|
||||
StrategicAddMilitiaToSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->ubSoldierClass - 4, 1 );
|
||||
|
||||
Reference in New Issue
Block a user