1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge pull request #5086 from kdmcser/commander_no_melee_penalty

Ensure the commander has no melee penalty when gaining the SHOOT ability
This commit is contained in:
Ivan Savenko
2024-12-21 16:02:26 +02:00
committed by GitHub
5 changed files with 25 additions and 13 deletions

View File

@ -259,10 +259,13 @@ void CGameHandler::levelUpCommander (const CCommanderInstance * c, int skill)
}
else if (skill >= 100)
{
scp.which = SetCommanderProperty::SPECIAL_SKILL;
scp.accumulatedBonus = *VLC->creh->skillRequirements.at(skill-100).first;
scp.additionalInfo = skill; //unnormalized
sendAndApply(scp);
for(auto & bonus : VLC->creh->skillRequirements.at(skill - 100).first)
{
scp.which = SetCommanderProperty::SPECIAL_SKILL;
scp.accumulatedBonus = *bonus;
scp.additionalInfo = skill; //unnormalized
sendAndApply(scp);
}
}
expGiven(hero);
}