diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index f7d717e8..9658d0f1 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -10453,7 +10453,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue ) } // enemy team gets a bonus if it has officers around - BOOL officertype = OFFICER_NONE; + UINT8 officertype = OFFICER_NONE; if ( HighestEnemyOfficersInSector( officertype ) ) { enemysidestrength = enemysidestrength * (1.0f + gGameExternalOptions.dEnemyOfficerSurrenderStrengthBonus * officertype); @@ -10807,7 +10807,7 @@ INT8 CalcEffectiveShockLevel( SOLDIERTYPE * pSoldier ) } // Flugente: count number of enemy officers -UINT8 HighestEnemyOfficersInSector( BOOL& aType ) +UINT8 HighestEnemyOfficersInSector( UINT8& aType ) { SOLDIERTYPE* pSoldier; INT32 cnt = 0; @@ -10818,7 +10818,8 @@ UINT8 HighestEnemyOfficersInSector( BOOL& aType ) { if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 ) { - if ( pSoldier->usSoldierFlagMask & SOLDIER_ENEMY_OFFICER ) + // count officers, but do not count those that we have already captured + if ( (pSoldier->usSoldierFlagMask & SOLDIER_ENEMY_OFFICER) && !(pSoldier->usSoldierFlagMask & SOLDIER_POW) ) { // officers with double squadleader trait are captains, otherwise lieutnant aType = max( aType, NUM_SKILL_TRAITS( pSoldier, SQUADLEADER_NT) ); diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index 63f98077..d429f0e8 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -398,7 +398,7 @@ enum { }; // Flugente: return number of enemy officers and highest rank found -UINT8 HighestEnemyOfficersInSector(BOOL& aType); +UINT8 HighestEnemyOfficersInSector(UINT8& aType); // count all soldiers in the current sector that have a specific flag set UINT16 NumSoldiersWithFlagInSector(UINT8 aTeam, UINT32 aFlag); diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 377a5627..bb08cc18 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -17240,7 +17240,7 @@ INT8 SOLDIERTYPE::GetSuppressionResistanceBonus( ) if ( this->bTeam == ENEMY_TEAM ) { // bonus if we have an officer around - BOOL officertype = OFFICER_NONE; + UINT8 officertype = OFFICER_NONE; if ( HighestEnemyOfficersInSector( officertype ) ) { bonus += gGameExternalOptions.sEnemyOfficerSuppressionResistanceBonus * officertype; @@ -17348,7 +17348,7 @@ FLOAT SOLDIERTYPE::GetMoraleModifier( ) { FLOAT mod = 1.0f; - BOOL officertype = OFFICER_NONE; + UINT8 officertype = OFFICER_NONE; if ( HighestEnemyOfficersInSector( officertype ) ) { mod += gGameExternalOptions.dEnemyOfficerMoraleModifier * officertype; diff --git a/Tactical/Soldier Create.cpp b/Tactical/Soldier Create.cpp index 644dc344..1640cffd 100644 --- a/Tactical/Soldier Create.cpp +++ b/Tactical/Soldier Create.cpp @@ -1760,7 +1760,7 @@ BOOLEAN TacticalCopySoldierFromCreateStruct( SOLDIERTYPE *pSoldier, SOLDIERCREAT if ( HAS_SKILL_TRAIT( pSoldier, SQUADLEADER_NT) ) { UINT8 numenemies = NumEnemyInSector(); - BOOL officertype = OFFICER_NONE; + UINT8 officertype = OFFICER_NONE; UINT8 numofficers = HighestEnemyOfficersInSector( officertype ); // this guy becomes an officer if there are enough soldiers around, and we aren't already at max of officers