mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Unified handling of battle sides ID's
- Replaced BattleSide namespace-enum with enum class - Merged two different BattleSide enum's into one - Merged BattlePerspective enum into BattleSide enum - Changed all places that use integers to represent battle side to use BattleSide enum - Added BattleSideArray convenience wrapper for std::array that is always 2-elements in size and allows access to its elements using BattleSide enum
This commit is contained in:
@@ -480,12 +480,12 @@ void CGCreature::flee( const CGHeroInstance * h ) const
|
||||
|
||||
void CGCreature::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
||||
{
|
||||
if(result.winner == 0)
|
||||
if(result.winner == BattleSide::ATTACKER)
|
||||
{
|
||||
giveReward(hero);
|
||||
cb->removeObject(this, hero->getOwner());
|
||||
}
|
||||
else if(result.winner > 1) // draw
|
||||
else if(result.winner == BattleSide::NONE) // draw
|
||||
{
|
||||
// guarded reward is lost forever on draw
|
||||
cb->removeObject(this, hero->getOwner());
|
||||
|
||||
Reference in New Issue
Block a user