1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #598 from nullkiller/ai-fix-3062

AI: blind fix for 3062
This commit is contained in:
Alexander Shishkin 2019-05-29 23:58:46 +03:00 committed by GitHub
commit c8888feafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,7 @@ TGoalVec GatherTroops::getAllPossibleSubgoals()
}*/
}
}
for(auto obj : ai->visitableObjs)
{
auto d = dynamic_cast<const CGDwelling *>(obj);
@ -135,6 +136,13 @@ 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;
//TODO: exchange troops between heroes
}