1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

GatherTroops: avoid crash if nearest dwelling wasn't found. Issue 2624

This commit is contained in:
Arseniy Shestakov 2016-11-29 21:57:00 +03:00
parent 72a36b92d6
commit fd3992ddc9

View File

@ -929,6 +929,8 @@ TSubgoal GatherTroops::whatToDoToAchieve()
// find hero who is nearest to a dwelling
const CGDwelling * nearest = boost::range::min_element(nearestDwellings, comparator)->second;
if(nearest) // FIXME: Find out what regression / bug cause this. Issue 2624
throw cannotFulfillGoalException("Cannot find nearest dwelling!");
return sptr (Goals::GetObj(nearest->id.getNum()));
}