mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +02:00
Revert "Merge branch 'pr/4528' into develop"
This reverts commitf4578c6d3a
, reversing changes made toac8e5b3711
.
This commit is contained in:
parent
3f8a8733a2
commit
64fad53532
@ -491,8 +491,6 @@ ReachabilityData BattleExchangeEvaluator::getExchangeUnits(
|
|||||||
vstd::concatenate(allReachableUnits, turn == 0 ? reachabilityMap.at(hex) : getOneTurnReachableUnits(turn, hex));
|
vstd::concatenate(allReachableUnits, turn == 0 ? reachabilityMap.at(hex) : getOneTurnReachableUnits(turn, hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ap.attack.attacker->isTurret())
|
|
||||||
{
|
|
||||||
for(auto hex : ap.attack.attacker->getHexes())
|
for(auto hex : ap.attack.attacker->getHexes())
|
||||||
{
|
{
|
||||||
auto unitsReachingAttacker = turn == 0 ? reachabilityMap.at(hex) : getOneTurnReachableUnits(turn, hex);
|
auto unitsReachingAttacker = turn == 0 ? reachabilityMap.at(hex) : getOneTurnReachableUnits(turn, hex);
|
||||||
@ -505,7 +503,6 @@ ReachabilityData BattleExchangeEvaluator::getExchangeUnits(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
vstd::removeDuplicates(allReachableUnits);
|
vstd::removeDuplicates(allReachableUnits);
|
||||||
|
|
||||||
|
@ -126,23 +126,20 @@ void HeroManager::update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::sort(myHeroes.begin(), myHeroes.end(), scoreSort);
|
std::sort(myHeroes.begin(), myHeroes.end(), scoreSort);
|
||||||
|
heroRoles.clear();
|
||||||
std::map<HeroPtr, HeroRole> newHeroRoles;
|
|
||||||
|
|
||||||
for(auto hero : myHeroes)
|
for(auto hero : myHeroes)
|
||||||
{
|
{
|
||||||
if(hero->patrol.patrolling)
|
if(hero->patrol.patrolling)
|
||||||
{
|
{
|
||||||
newHeroRoles[hero] = HeroRole::MAIN;
|
heroRoles[hero] = HeroRole::MAIN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newHeroRoles[hero] = (globalMainCount--) > 0 ? HeroRole::MAIN : HeroRole::SCOUT;
|
heroRoles[hero] = (globalMainCount--) > 0 ? HeroRole::MAIN : HeroRole::SCOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
heroRoles = std::move(newHeroRoles);
|
|
||||||
|
|
||||||
for(auto hero : myHeroes)
|
for(auto hero : myHeroes)
|
||||||
{
|
{
|
||||||
logAi->trace("Hero %s has role %s", hero->getNameTranslated(), heroRoles[hero] == HeroRole::MAIN ? "main" : "scout");
|
logAi->trace("Hero %s has role %s", hero->getNameTranslated(), heroRoles[hero] == HeroRole::MAIN ? "main" : "scout");
|
||||||
|
Loading…
Reference in New Issue
Block a user