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 committed by GitHub
parent 0d33fcccbf
commit c510340ed2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -350,7 +350,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