1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Give bonus experience for capturing a town even if the enemy hero escaped.

This commit is contained in:
Krisztián Szabó 2023-09-11 19:51:23 +02:00
parent 6a5e71aa63
commit cb3cc84c61

View File

@ -241,13 +241,13 @@ void BattleResultProcessor::endBattle(const CBattleInfoCallback & battle)
battleResult->exp[1] += 500;
if(heroDefender)
battleResult->exp[0] += 500;
// Give 500 exp to winner if a town was conquered during the battle
const auto * defendedTown = battle.battleGetDefendedTown();
if (defendedTown && battleResult->winner == BattleSide::ATTACKER)
battleResult->exp[BattleSide::ATTACKER] += 500;
}
// Give 500 exp to winner if a town was conquered during the battle
const auto * defendedTown = battle.battleGetDefendedTown();
if (defendedTown && battleResult->winner == BattleSide::ATTACKER)
battleResult->exp[BattleSide::ATTACKER] += 500;
if(heroAttacker)
battleResult->exp[0] = heroAttacker->calculateXp(battleResult->exp[0]);//scholar skill
if(heroDefender)