Fix: enemy tanks spawned by cheats are not added to the sector count

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7980 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-08-18 19:26:41 +00:00
parent a87200619a
commit 8a84db40d4
2 changed files with 23 additions and 13 deletions
+17 -9
View File
@@ -6589,9 +6589,6 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS
return; return;
}*/ }*/
// Flugente: tanks get a special icon, so we need to count them separately
UINT16 usNumTanks = NumTanksInSector( sSectorX, sSectorY, ENEMY_TEAM );
switch ( WhatPlayerKnowsAboutEnemiesInSector( sSectorX, sSectorY ) ) switch ( WhatPlayerKnowsAboutEnemiesInSector( sSectorX, sSectorY ) )
{ {
// HEADROCK HAM 5: New cases below for showing enemy group heading. // HEADROCK HAM 5: New cases below for showing enemy group heading.
@@ -6612,16 +6609,27 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS
break; break;
case KNOWS_HOW_MANY: case KNOWS_HOW_MANY:
// display individual icons for each enemy, starting at the received icon position index {
ShowEnemiesInSector( sSectorX, sSectorY, sNumberOfEnemies, usNumTanks, ubIconPosition ); // Flugente: tanks get a special icon, so we need to count them separately
UINT16 usNumTanks = NumTanksInSector( sSectorX, sSectorY, ENEMY_TEAM );
// display individual icons for each enemy, starting at the received icon position index
ShowEnemiesInSector( sSectorX, sSectorY, sNumberOfEnemies, usNumTanks, ubIconPosition );
}
break; break;
// HEADROCK HAM 5: New case for showing enemy groups AND where the are headed. // HEADROCK HAM 5: New case for showing enemy groups AND where the are headed.
case KNOWS_HOW_MANY_AND_WHERE_GOING: case KNOWS_HOW_MANY_AND_WHERE_GOING:
// display individual icons for each enemy, starting at the received icon position index {
ShowEnemiesInSector( sSectorX, sSectorY, sNumberOfEnemies, usNumTanks, ubIconPosition ); // Flugente: tanks get a special icon, so we need to count them separately
// display their direction of movement, if valid. UINT16 usNumTanks = NumTanksInSector( sSectorX, sSectorY, ENEMY_TEAM );
ShowNonPlayerGroupsInMotion( sSectorX, sSectorY, ENEMY_TEAM );
// display individual icons for each enemy, starting at the received icon position index
ShowEnemiesInSector( sSectorX, sSectorY, sNumberOfEnemies, usNumTanks, ubIconPosition );
// display their direction of movement, if valid.
ShowNonPlayerGroupsInMotion( sSectorX, sSectorY, ENEMY_TEAM );
}
break; break;
} }
} }
+5 -3
View File
@@ -1174,9 +1174,10 @@ UINT32 UIHandleNewBadMerc( UI_EVENT *pUIEvent )
SECTORINFO *pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ]; SECTORINFO *pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ];
switch( pSoldier->ubSoldierClass ) switch( pSoldier->ubSoldierClass )
{ {
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break; case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break; case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break; case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
case SOLDIER_CLASS_TANK: pSector->ubNumTanks++; pSector->ubTanksInBattle++; break;
} }
} }
else else
@@ -1189,6 +1190,7 @@ UINT32 UIHandleNewBadMerc( UI_EVENT *pUIEvent )
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break; case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break; case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break; case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
case SOLDIER_CLASS_TANK: pSector->ubNumTanks++; pSector->ubTanksInBattle++; break;
} }
} }
} }