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) );
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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