Compare scout candidate unit power correctly

Fix the army-transfer tie breaker used when a scout must keep one stack
after handing army to a stronger hero.

The right-hand unit power accidentally reused the left-hand value, so
equal-movement candidates could leave an expensive unit on the scout
while transferring cheaper army.
This commit is contained in:
Boris Nagaev
2026-06-08 15:34:55 -05:00
parent a33bcada4e
commit 8eebcfe491
+1 -1
View File
@@ -130,7 +130,7 @@ std::vector<SlotInfo>::iterator ArmyManager::getBestUnitForScout(std::vector<Slo
auto fastest = boost::min_element(army, [&](const SlotInfo & left, const SlotInfo & right) -> bool
{
uint64_t leftUnitPower = left.power / left.count;
uint64_t rightUnitPower = left.power / left.count;
uint64_t rightUnitPower = right.power / right.count;
bool leftUnitIsWeak = leftUnitPower < maxUnitValue || left.creature->getLevel() < 4;
bool rightUnitIsWeak = rightUnitPower < maxUnitValue || right.creature->getLevel() < 4;