mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Update AI/Nullkiller/Behaviors/RecruitHeroBehavior.cpp
Avoid checking float against an exact value. Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
@ -87,7 +87,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose(const Nullkiller * ai) const
|
|||||||
score *= hero->getArmyCost();
|
score *= hero->getArmyCost();
|
||||||
if (hero->type->heroClass->faction == town->getFaction())
|
if (hero->type->heroClass->faction == town->getFaction())
|
||||||
score *= 1.5;
|
score *= 1.5;
|
||||||
if (visitability == 0)
|
if (vstd::isAlmostZero(visitability))
|
||||||
score *= 30 * town->getTownLevel();
|
score *= 30 * town->getTownLevel();
|
||||||
else
|
else
|
||||||
score *= town->getTownLevel() / visitability;
|
score *= town->getTownLevel() / visitability;
|
||||||
|
Reference in New Issue
Block a user