fix crash when out-of-bounds 'tile' hovered in minimap
This commit is contained in:
@@ -1455,7 +1455,10 @@ void handle_one_minimap_event(const sf::Event& event) {
|
|||||||
tile.y += (y - (29 * get_ui_scale_map())) / get_ui_scale_map() / 6;
|
tile.y += (y - (29 * get_ui_scale_map())) / get_ui_scale_map() / 6;
|
||||||
|
|
||||||
std::string tooltip_text = "";
|
std::string tooltip_text = "";
|
||||||
if(is_explored(tile.x, tile.y)){
|
bool is_on_map;
|
||||||
|
if(is_out()) is_on_map = tile.x >= 0 && tile.y >= 0 && tile.x < 48 && tile.y < 48;
|
||||||
|
else is_on_map = univ.town->is_on_map(tile);
|
||||||
|
if(is_on_map && is_explored(tile.x, tile.y)){
|
||||||
// Area rectangle hovered
|
// Area rectangle hovered
|
||||||
const std::vector<info_rect_t>& area_desc = is_out() ? univ.out->area_desc : univ.town->area_desc;
|
const std::vector<info_rect_t>& area_desc = is_out() ? univ.out->area_desc : univ.town->area_desc;
|
||||||
for(info_rect_t area : area_desc){
|
for(info_rect_t area : area_desc){
|
||||||
|
Reference in New Issue
Block a user