mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
- Bugfix: At the end of an underground battle, all stationary enemy garrisons in the SURFACE sector directly above disappear completely (by Headrock & Wil473)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3087 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+17
-5
@@ -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->ubNumAdmins = pSectorInfo->ubNumTroops = pSectorInfo->ubNumElites = 0;
|
||||||
pSectorInfo->ubAdminsInBattle = pSectorInfo->ubTroopsInBattle = pSectorInfo->ubElitesInBattle = 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:
|
//IMPORTANT NEW NOTE:
|
||||||
//Whenever returning TRUE, make sure you clear gfBlitBattleSectorLocator;
|
//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
|
// 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!
|
// If here, the battle has been won!
|
||||||
|
|||||||
Reference in New Issue
Block a user