fix segfault on area= filter.

areas_ might be empty, so areas_[0] might crash, also returning areas_[0].hexes didn't really make sense in the first place
This commit is contained in:
gfgtdf 2018-04-21 20:57:15 +02:00
parent 092f8f325c
commit 41d7df970c

View file

@ -349,7 +349,8 @@ const std::set<map_location>& tod_manager::get_area_by_id(const std::string& id)
if (area.id == id)
return area.hexes;
}
return areas_[0].hexes;
static const std::set<map_location> res;
return res;
}
const std::set<map_location>& tod_manager::get_area_by_index(int index) const