diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 4dd5a924b..7f71c1e9d 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -6203,14 +6203,26 @@ void DeathNoMessageTimerCallback( void ) } } -void RemoveStaticEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY ) +void RemoveStaticEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) { - SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); + if (!bMapZ) // Battle ended Above-ground + { + SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); - pSectorInfo->ubNumAdmins = pSectorInfo->ubNumTroops = pSectorInfo->ubNumElites = 0; - pSectorInfo->ubAdminsInBattle = pSectorInfo->ubTroopsInBattle = pSectorInfo->ubElitesInBattle = 0; + pSectorInfo->ubNumAdmins = pSectorInfo->ubNumTroops = pSectorInfo->ubNumElites = 0; + pSectorInfo->ubAdminsInBattle = pSectorInfo->ubTroopsInBattle = pSectorInfo->ubElitesInBattle = 0; + } + else + { + UNDERGROUND_SECTORINFO *pSectorInfo; + + pSectorInfo = FindUnderGroundSector( sMapX, sMapY, bMapZ ); + pSectorInfo->ubNumAdmins = pSectorInfo->ubNumTroops = pSectorInfo->ubNumElites = 0; + pSectorInfo->ubAdminsInBattle = pSectorInfo->ubTroopsInBattle = pSectorInfo->ubElitesInBattle = 0; + } } + //!!!! //IMPORTANT NEW NOTE: //Whenever returning TRUE, make sure you clear gfBlitBattleSectorLocator; @@ -6371,7 +6383,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated ) } // Kill all enemies. Sometime even after killing all the enemies, there appeares "in battle" enemies in sector info - RemoveStaticEnemiesFromSectorInfo( gWorldSectorX, gWorldSectorY ); + RemoveStaticEnemiesFromSectorInfo( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); // If here, the battle has been won!