mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Lessen repetition
This commit is contained in:
@@ -560,12 +560,14 @@ void EndTacticalBattleForEnemy()
|
||||
//severe loyalty blow.
|
||||
for( i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++i )
|
||||
{
|
||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->bInSector && MercPtrs[ i ]->stats.bLife >= OKLIFE )
|
||||
SOLDIERTYPE *pSoldier = MercPtrs[i];
|
||||
if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE )
|
||||
{ //found one live militia, so look for any enemies/creatures.
|
||||
// NOTE: this is relying on ENEMY_TEAM being immediately followed by CREATURE_TEAM
|
||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++i )
|
||||
for(UINT16 j = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; j <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++i )
|
||||
{
|
||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->bInSector && MercPtrs[ i ]->stats.bLife >= OKLIFE )
|
||||
SOLDIERTYPE *pEnemy = MercPtrs[j];
|
||||
if( pEnemy->bActive && pEnemy->bInSector && pEnemy->stats.bLife >= OKLIFE )
|
||||
{ //confirmed at least one enemy here, so do the loyalty penalty.
|
||||
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ABANDON_MILITIA, gWorldSectorX, gWorldSectorY, 0 );
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user