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
+18 -10
View File
@@ -6588,10 +6588,7 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS
// nope - display nothing
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 ) )
{
// HEADROCK HAM 5: New cases below for showing enemy group heading.
@@ -6612,16 +6609,27 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS
break;
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;
// HEADROCK HAM 5: New case for showing enemy groups AND where the are headed.
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 );
// display their direction of movement, if valid.
ShowNonPlayerGroupsInMotion( sSectorX, sSectorY, ENEMY_TEAM );
{
// 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 );
// display their direction of movement, if valid.
ShowNonPlayerGroupsInMotion( sSectorX, sSectorY, ENEMY_TEAM );
}
break;
}
}
+5 -3
View File
@@ -1174,9 +1174,10 @@ UINT32 UIHandleNewBadMerc( UI_EVENT *pUIEvent )
SECTORINFO *pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ];
switch( pSoldier->ubSoldierClass )
{
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
case SOLDIER_CLASS_TANK: pSector->ubNumTanks++; pSector->ubTanksInBattle++; break;
}
}
else
@@ -1189,6 +1190,7 @@ UINT32 UIHandleNewBadMerc( UI_EVENT *pUIEvent )
case SOLDIER_CLASS_ADMINISTRATOR: pSector->ubNumAdmins++; pSector->ubAdminsInBattle++; break;
case SOLDIER_CLASS_ARMY: pSector->ubNumTroops++; pSector->ubTroopsInBattle++; break;
case SOLDIER_CLASS_ELITE: pSector->ubNumElites++; pSector->ubElitesInBattle++; break;
case SOLDIER_CLASS_TANK: pSector->ubNumTanks++; pSector->ubTanksInBattle++; break;
}
}
}