1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

One more fix.

This commit is contained in:
DjWarmonger 2013-12-24 22:12:12 +00:00
parent a8539b2b28
commit 12bb9221d1

View File

@ -278,8 +278,12 @@ float GetObj::importanceWhenLocked() const
bool GetObj::fulfillsMe (TSubgoal goal)
{
if (goal->goalType == Goals::VISIT_TILE && cb->getObj(ObjectInstanceID(objid))->visitablePos() == goal->tile)
return true;
if (goal->goalType == Goals::VISIT_TILE)
{
auto obj = cb->getObj(ObjectInstanceID(objid));
if (obj && obj->visitablePos() == goal->tile) //object could be removed
return true;
}
else
return false;
}