1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Secondary skill bonuses will now be correctly updated on level-up.

This commit is contained in:
DjWarmonger 2010-07-21 17:05:07 +00:00
parent 90faf3fbdc
commit a8bb13cbcd
2 changed files with 3 additions and 3 deletions

View File

@ -615,8 +615,7 @@ int3 CGHeroInstance::getPosition(bool h3m) const //h3m=true - returns position o
si32 CGHeroInstance::manaLimit() const si32 CGHeroInstance::manaLimit() const
{ {
double modifier = (100.0f + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, 24)) / 100.0f; return si32(getPrimSkillLevel(3) * (100.0f + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, 24)) / 10.0f);
return si32(10*getPrimSkillLevel(3)*modifier);
} }
//void CGHeroInstance::setPosition(int3 Pos, bool h3m) //as above, but sets position //void CGHeroInstance::setPosition(int3 Pos, bool h3m) //as above, but sets position
//{ //{

View File

@ -80,6 +80,7 @@ DLL_EXPORT void SetSecSkill::applyGs( CGameState *gs )
if(hero->getSecSkillLevel(which) == 0) if(hero->getSecSkillLevel(which) == 0)
{ {
hero->secSkills.push_back(std::pair<int,int>(which, val)); hero->secSkills.push_back(std::pair<int,int>(which, val));
hero->updateSkill(which, val);
} }
else else
{ {
@ -97,10 +98,10 @@ DLL_EXPORT void SetSecSkill::applyGs( CGameState *gs )
tlog1 << "Warning: Skill " << which << " increased over limit! Decreasing to Expert.\n"; tlog1 << "Warning: Skill " << which << " increased over limit! Decreasing to Expert.\n";
hero->secSkills[i].second = 3; hero->secSkills[i].second = 3;
} }
hero->updateSkill(which, hero->secSkills[i].second); //when we know final value
} }
} }
} }
hero->updateSkill(which, val);
} }
DLL_EXPORT void HeroVisitCastle::applyGs( CGameState *gs ) DLL_EXPORT void HeroVisitCastle::applyGs( CGameState *gs )