mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Fix: if an enemy jeep is destroyed, sector jeep count is not properly updated
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8168 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1007,7 +1007,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOLDIER_CLASS_JEEP:
|
case SOLDIER_CLASS_JEEP:
|
||||||
if ( ubNumTanks )
|
if ( ubNumJeeps )
|
||||||
{
|
{
|
||||||
num--;
|
num--;
|
||||||
sNumSlots--;
|
sNumSlots--;
|
||||||
@@ -1180,6 +1180,35 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case COMBAT_JEEP_CAR:
|
||||||
|
if ( !pSoldier->bSectorZ )
|
||||||
|
{
|
||||||
|
pSector = &SectorInfo[SECTOR( pSoldier->sSectorX, pSoldier->sSectorY )];
|
||||||
|
if ( pSector->ubNumJeeps )
|
||||||
|
{
|
||||||
|
pSector->ubNumJeeps--;
|
||||||
|
}
|
||||||
|
if ( pSector->ubJeepsInBattle )
|
||||||
|
{
|
||||||
|
pSector->ubJeepsInBattle--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UNDERGROUND_SECTORINFO *pUnderground;
|
||||||
|
pUnderground = FindUnderGroundSector( (UINT8)pSoldier->sSectorX, (UINT8)pSoldier->sSectorY, (UINT8)pSoldier->bSectorZ );
|
||||||
|
Assert( pUnderground );
|
||||||
|
if ( pUnderground->ubNumJeeps )
|
||||||
|
{
|
||||||
|
pUnderground->ubNumJeeps--;
|
||||||
|
}
|
||||||
|
if ( pUnderground->ubJeepsInBattle )
|
||||||
|
{
|
||||||
|
pUnderground->ubJeepsInBattle--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pSoldier->aiData.bNeutral || pSoldier->bTeam != ENEMY_TEAM && pSoldier->bTeam != CREATURE_TEAM )
|
if( pSoldier->aiData.bNeutral || pSoldier->bTeam != ENEMY_TEAM && pSoldier->bTeam != CREATURE_TEAM )
|
||||||
@@ -1333,7 +1362,7 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
ubTotalEnemies = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks;
|
ubTotalEnemies = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks + pSector->ubNumJeeps;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch( pSoldier->ubSoldierClass )
|
switch( pSoldier->ubSoldierClass )
|
||||||
@@ -1446,7 +1475,7 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
|||||||
{ //basement level (UNDERGROUND_SECTORINFO)
|
{ //basement level (UNDERGROUND_SECTORINFO)
|
||||||
UNDERGROUND_SECTORINFO *pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
UNDERGROUND_SECTORINFO *pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
UINT32 ubTotalEnemies = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks;
|
UINT32 ubTotalEnemies = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks + pSector->ubNumJeeps;
|
||||||
#endif
|
#endif
|
||||||
if( pSector )
|
if( pSector )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user