mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-30 23:18:08 +02:00
Merge pull request #2800 from PandarinDev/missing_exp_for_towns
Award 500 experience for towns conquered during a battle.
This commit is contained in:
commit
7f321b2fcb
@ -243,6 +243,11 @@ void BattleResultProcessor::endBattle(const CBattleInfoCallback & battle)
|
||||
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;
|
||||
|
||||
if(heroAttacker)
|
||||
battleResult->exp[0] = heroAttacker->calculateXp(battleResult->exp[0]);//scholar skill
|
||||
if(heroDefender)
|
||||
|
Loading…
Reference in New Issue
Block a user