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,18 +491,15 @@ 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);
|
||||||
|
for(auto unit : unitsReachingAttacker)
|
||||||
{
|
{
|
||||||
auto unitsReachingAttacker = turn == 0 ? reachabilityMap.at(hex) : getOneTurnReachableUnits(turn, hex);
|
if(unit->unitSide() != ap.attack.attacker->unitSide())
|
||||||
for(auto unit : unitsReachingAttacker)
|
|
||||||
{
|
{
|
||||||
if(unit->unitSide() != ap.attack.attacker->unitSide())
|
allReachableUnits.push_back(unit);
|
||||||
{
|
result.enemyUnitsReachingAttacker.insert(unit->unitId());
|
||||||
allReachableUnits.push_back(unit);
|
|
||||||
result.enemyUnitsReachingAttacker.insert(unit->unitId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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