Skip to content

Commit

Permalink
Improved morale with undead army
Browse files Browse the repository at this point in the history
When the player has an undead army, the moral does not apply. The issue is that the info is still (partially calculated)
and displayed. The artifacts are taken into consideration but not the skills / tavern.
With this commit the morale is always calculated & displayed in the hero menu.
  • Loading branch information
felix642 committed Dec 31, 2024
1 parent 7ee9d84 commit bff88f7
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/fheroes2/army/army.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,18 +1207,13 @@ int Army::GetMoraleModificator( std::string * strs ) const
// different race penalty
std::set<int> races;
bool hasUndead = false;
bool allUndead = true;

for ( const Troop * troop : *this )
if ( troop->isValid() ) {
races.insert( troop->GetRace() );
hasUndead = hasUndead || troop->isUndead();
allUndead = allUndead && troop->isUndead();
}

if ( allUndead )
return Morale::NORMAL;

int result = Morale::NORMAL;

// check castle modificator
Expand Down

0 comments on commit bff88f7

Please sign in to comment.