1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

add multi-bonuses support for creature speical skills

This commit is contained in:
kdmcser
2024-12-15 02:31:44 +08:00
parent 3f9986c88e
commit c7b22b1b28
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);
}