1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

New object target handling in wander

This commit is contained in:
Dydzio
2018-08-09 16:28:15 +02:00
parent 01709bd196
commit 616a6bbdf7
2 changed files with 11 additions and 10 deletions

View File

@ -1142,7 +1142,7 @@ TGoalVec Goals::CollectRes::getAllPossibleSubgoals()
if (dest != t) //there is something blocking our way
ret.push_back(sptr(Goals::ClearWayTo(dest, h).setisAbstract(true)));
else
ret.push_back(sptr(Goals::VisitTile(dest).sethero(h).setisAbstract(true)));
ret.push_back(sptr(Goals::GetObj(obj->id.getNum()).sethero(h).setisAbstract(true)));
}
else //we need to get army in order to pick that object
ret.push_back(sptr(Goals::GatherArmy(evaluateDanger(dest, h) * SAFE_ATTACK_CONSTANT).sethero(h).setisAbstract(true)));