1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-09 13:14:02 +02:00

AI: blind fix for 3062

This commit is contained in:
Andrii Danylchenko 2019-05-28 09:04:31 +03:00
parent 54bbf2abb3
commit 0bd5782470

View File

@ -115,6 +115,7 @@ TGoalVec GatherTroops::getAllPossibleSubgoals()
}*/ }*/
} }
} }
for(auto obj : ai->visitableObjs) for(auto obj : ai->visitableObjs)
{ {
auto d = dynamic_cast<const CGDwelling *>(obj); auto d = dynamic_cast<const CGDwelling *>(obj);
@ -135,6 +136,12 @@ TGoalVec GatherTroops::getAllPossibleSubgoals()
} }
} }
CreatureID creID = CreatureID(objid);
vstd::erase_if(solutions, [&](TSubgoal goal)->bool{
return goal->hero && !goal->hero->getSlotFor(creID).validSlot() && !goal->hero->getFreeSlot().validSlot();
});
return solutions; return solutions;
//TODO: exchange troops between heroes //TODO: exchange troops between heroes
} }