mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Remove bLastKnownEnemies from SECTORINFO
As per the old comment, even though the field value is updated partially according to whether there are known enemies present or not, it's not used for anything.
This commit is contained in:
@@ -460,7 +460,6 @@ void EliminateAllEnemies( UINT8 ubSectorX, UINT8 ubSectorY )
|
||||
pSector->ubNumJeeps = 0;
|
||||
pSector->ubNumRobots = 0;
|
||||
pSector->ubNumCreatures = 0;
|
||||
pSector->bLastKnownEnemies = 0;
|
||||
//Remove the mobile forces here, but only if battle is over.
|
||||
while( pGroup )
|
||||
{
|
||||
@@ -1839,7 +1838,6 @@ void RenderAutoResolve()
|
||||
HandleMoraleEvent( NULL, MORALE_BATTLE_WON, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_WON, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
|
||||
|
||||
SectorInfo[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].bLastKnownEnemies = 0;
|
||||
SetThisSectorAsPlayerControlled( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
|
||||
#ifdef NEWMUSIC
|
||||
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0];
|
||||
|
||||
@@ -500,9 +500,6 @@ typedef struct SECTORINFO
|
||||
UINT16 ubNumCreatures; //only set when immediately before ground attack made!
|
||||
UINT16 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||
|
||||
INT8 bLastKnownEnemies; // -1 means never been there, no idea, otherwise it's what we'd observed most recently
|
||||
// while this is being maintained (partially, surely buggy), nothing uses it anymore. ARM
|
||||
|
||||
UINT32 ubDayOfLastCreatureAttack;
|
||||
UINT32 uiFacilitiesFlags; // the flags for various facilities
|
||||
|
||||
|
||||
@@ -407,8 +407,6 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
gubPBSectorY = gpBattleGroup->ubSectorY;
|
||||
gubPBSectorZ = gpBattleGroup->ubSectorZ;
|
||||
|
||||
// get number of enemies thought to be here
|
||||
SectorInfo[SECTOR( gubPBSectorX, gubPBSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( gubPBSectorX, gubPBSectorY, ENEMY_TEAM );
|
||||
fMapPanelDirty = TRUE;
|
||||
}
|
||||
else if( gfPersistantPBI )
|
||||
@@ -1547,14 +1545,12 @@ void RenderPreBattleInterface()
|
||||
{
|
||||
// don't know how many
|
||||
swprintf( str, L"?" );
|
||||
SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ].bLastKnownEnemies = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
// know exactly how many
|
||||
i = NumNonPlayerTeamMembersInSector( gubPBSectorX, gubPBSectorY, ENEMY_TEAM );
|
||||
swprintf( str, L"%d", i );
|
||||
SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ].bLastKnownEnemies = (INT8)i;
|
||||
}
|
||||
x = 57 + (27 - StringPixLength( str, FONT14ARIAL )) / 2;
|
||||
y = 36;
|
||||
|
||||
@@ -1190,7 +1190,6 @@ BOOLEAN PrepareEnemyForUndergroundBattle()
|
||||
//The queen AI layer must process the event by subtracting forces, etc.
|
||||
void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT32 iNumEnemiesInSector;
|
||||
SECTORINFO *pSector;
|
||||
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand");
|
||||
@@ -1737,22 +1736,6 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !pSoldier->bSectorZ )
|
||||
{
|
||||
pSector = &SectorInfo[ SECTOR( pSoldier->sSectorX, pSoldier->sSectorY ) ];
|
||||
iNumEnemiesInSector = NumNonPlayerTeamMembersInSector( pSoldier->sSectorX, pSoldier->sSectorY, ENEMY_TEAM );
|
||||
if( iNumEnemiesInSector )
|
||||
{
|
||||
if( pSector->bLastKnownEnemies >= 0 )
|
||||
{
|
||||
pSector->bLastKnownEnemies = (INT8)iNumEnemiesInSector;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pSector->bLastKnownEnemies = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Well, not so rarely with mobile reinforcements!
|
||||
|
||||
@@ -1946,11 +1946,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
|
||||
if ( pGroup->usGroupTeam == OUR_TEAM )
|
||||
{
|
||||
if( pGroup->ubSectorZ == 0 )
|
||||
{
|
||||
SectorInfo[SECTOR( pGroup->ubSectorX, pGroup->ubSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( pGroup->ubSectorX, pGroup->ubSectorY, ENEMY_TEAM );
|
||||
}
|
||||
|
||||
// Flugente: do not award experience gain if we never left
|
||||
if (!fNeverLeft)
|
||||
{
|
||||
@@ -3769,8 +3764,6 @@ INT32 GetTravelTimeForFootTeam( UINT8 ubSector, UINT8 ubDirection )
|
||||
void HandleArrivalOfReinforcements( GROUP *pGroup )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
SECTORINFO *pSector;
|
||||
INT32 iNumEnemiesInSector;
|
||||
INT32 cnt;
|
||||
|
||||
if ( pGroup->usGroupTeam == OUR_TEAM )
|
||||
@@ -3834,22 +3827,6 @@ void HandleArrivalOfReinforcements( GROUP *pGroup )
|
||||
gfPendingNonPlayerTeam[MILITIA_TEAM] = TRUE;
|
||||
AddPossiblePendingMilitiaToBattle( );
|
||||
}
|
||||
|
||||
//Update the known number of enemies in the sector.
|
||||
pSector = &SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ];
|
||||
iNumEnemiesInSector = NumNonPlayerTeamMembersInSector( pGroup->ubSectorX, pGroup->ubSectorY, ENEMY_TEAM );
|
||||
if( iNumEnemiesInSector )
|
||||
{
|
||||
if( pSector->bLastKnownEnemies >= 0 )
|
||||
{
|
||||
pSector->bLastKnownEnemies = (INT8)iNumEnemiesInSector;
|
||||
}
|
||||
//if we don't know how many enemies there are, then we can't update this value.
|
||||
}
|
||||
else
|
||||
{
|
||||
pSector->bLastKnownEnemies = 0;
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN PlayersBetweenTheseSectors( INT16 sSource, INT16 sDest, INT32 *iCountEnter, INT32 *iCountExit, BOOLEAN *fAboutToArriveEnter )
|
||||
|
||||
@@ -7520,11 +7520,6 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
||||
|
||||
if ( fBattleLost || fBattleWon )
|
||||
{
|
||||
if( !gbWorldSectorZ )
|
||||
{
|
||||
SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( gWorldSectorX, gWorldSectorY, ENEMY_TEAM );
|
||||
}
|
||||
|
||||
// Flugente: note number of wounded for campaign stats
|
||||
UpdateWoundedFromSectorInfo( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user