1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Optimized getHeroStrength method

- replaced 4x access to bonus system with single access
- fixed formula for Diplomacy
- fxied formula for hero transfer in campaigns
- removed pointless sqrt(pow()) construct
This commit is contained in:
Ivan Savenko
2024-12-22 14:49:35 +00:00
parent 5caf12f22f
commit e035cf9e63
7 changed files with 89 additions and 29 deletions

View File

@@ -339,7 +339,7 @@ void CampaignState::setCurrentMapAsConquered(std::vector<CGHeroInstance *> heroe
{
range::sort(heroes, [](const CGHeroInstance * a, const CGHeroInstance * b)
{
return a->getHeroStrengthForCampaign() > b->getHeroStrengthForCampaign();
return a->getValueForCampaign() > b->getValueForCampaign();
});
logGlobal->info("Scenario %d of campaign %s (%s) has been completed", currentMap->getNum(), getFilename(), getNameTranslated());