Fix: captured enemy officers still provided boni

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7760 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-02-28 15:32:51 +00:00
parent b7612ab64e
commit f6f19d01cd
4 changed files with 8 additions and 7 deletions
+4 -3
View File
@@ -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) );