Skip to content

Fix Nationalism and Patriotism bonuses being applied regardless of horde status #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4466,20 +4466,24 @@ void AIUpdateInterface::evaluateMoraleBonus( void )
//if ( draw && !us->isKindOf( KINDOF_PORTABLE_STRUCTURE ) )
// draw->setTerrainDecal(TERRAIN_DECAL_NONE);

// TheSuperHackers @bugfix GeneralCamo 06/03/2025 Corrected nationalism being applied regardless of horde status - issue #173
// horde
if( horde )
{
if ( horde ) {
us->setWeaponBonusCondition( WEAPONBONUSCONDITION_HORDE );

} // end if
else
// nationalism
if (nationalism) {
us->setWeaponBonusCondition( WEAPONBONUSCONDITION_NATIONALISM );
}
else {
us->clearWeaponBonusCondition( WEAPONBONUSCONDITION_NATIONALISM );
}
}
else {
us->clearWeaponBonusCondition( WEAPONBONUSCONDITION_HORDE );

// nationalism
if( nationalism )
us->setWeaponBonusCondition( WEAPONBONUSCONDITION_NATIONALISM );
else
us->clearWeaponBonusCondition( WEAPONBONUSCONDITION_NATIONALISM );
}
// end @bugfix

} // end if
#ifdef ALLOW_DEMORALIZE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4735,27 +4735,31 @@ void AIUpdateInterface::evaluateMoraleBonus( void )
//if ( draw && !us->isKindOf( KINDOF_PORTABLE_STRUCTURE ) )
// draw->setTerrainDecal(TERRAIN_DECAL_NONE);

// TheSuperHackers @bugfix GeneralCamo 06/03/2025 Corrected nationalism being applied regardless of horde status - issue #173
// horde
if( horde )
{
us->setWeaponBonusCondition( WEAPONBONUSCONDITION_HORDE );

} // end if
else
us->clearWeaponBonusCondition( WEAPONBONUSCONDITION_HORDE );

// nationalism
if( nationalism )
{
us->setWeaponBonusCondition( WEAPONBONUSCONDITION_NATIONALISM );
// fanaticism
if ( fanaticism )
us->setWeaponBonusCondition( WEAPONBONUSCONDITION_FANATICISM );// FOR THE NEW GC INFANTRY GENERAL
else
us->clearWeaponBonusCondition( WEAPONBONUSCONDITION_FANATICISM );
}
else
us->clearWeaponBonusCondition( WEAPONBONUSCONDITION_NATIONALISM );
if (horde) {
us->setWeaponBonusCondition(WEAPONBONUSCONDITION_HORDE);

// nationalism
if (nationalism) {
us->setWeaponBonusCondition(WEAPONBONUSCONDITION_NATIONALISM);
} else {
us->clearWeaponBonusCondition(WEAPONBONUSCONDITION_NATIONALISM);
}

// fanaticism
if (fanaticism) {
us->setWeaponBonusCondition(WEAPONBONUSCONDITION_FANATICISM);// FOR THE NEW GC INFANTRY GENERAL
} else {
us->clearWeaponBonusCondition(WEAPONBONUSCONDITION_FANATICISM);
}

} else {
us->clearWeaponBonusCondition(WEAPONBONUSCONDITION_HORDE);
us->clearWeaponBonusCondition(WEAPONBONUSCONDITION_NATIONALISM);
us->clearWeaponBonusCondition(WEAPONBONUSCONDITION_FANATICISM);
}
// end @bugfix



Expand Down