1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Award 500 experience for towns conquered during a battle.

This commit is contained in:
Krisztián Szabó 2023-09-11 09:32:14 +02:00 committed by Ivan Savenko
parent d070953c28
commit b9b51334eb

View File

@ -589,6 +589,11 @@ void CGameHandler::endBattle(int3 tile, const CGHeroInstance * heroAttacker, con
battleResult.data->exp[0] += 500;
}
// Give 500 exp to winner if a town was conquered during the battle
const auto * defendedTown = battleGetDefendedTown();
if (defendedTown && battleResult.data->winner == BattleSide::ATTACKER)
battleResult.data->exp[BattleSide::ATTACKER] += 500;
if(heroAttacker)
battleResult.data->exp[0] = heroAttacker->calculateXp(battleResult.data->exp[0]);//scholar skill
if(heroDefender)