diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 177d5714..7a3f8fa4 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -1465,6 +1465,7 @@ void handle_one_minimap_event(const sf::Event& event) { // Area rectangle hovered const std::vector& area_desc = is_out() ? univ.out->area_desc : univ.town->area_desc; for(info_rect_t area : area_desc){ + if(area.empty()) continue; if(area.contains(tile)){ tooltip_text += area.descr + " |"; } diff --git a/src/game/boe.text.cpp b/src/game/boe.text.cpp index 2aa7a3ac..c3d86fcb 100644 --- a/src/game/boe.text.cpp +++ b/src/game/boe.text.cpp @@ -1261,19 +1261,13 @@ std::string get_location(cUniverse* specific_univ) { std::string loc_str = ""; location loc = outdoors ? global_to_local(specific_univ->party.out_loc) : specific_univ->party.town_loc; - if(outdoors) { - loc_str = specific_univ->out->name; - for(short i = 0; i < specific_univ->out->area_desc.size(); i++) - if(loc.in(specific_univ->out->area_desc[i])) { - loc_str = specific_univ->out->area_desc[i].descr; - } - } - if(town){ - loc_str = specific_univ->town->name; - for(short i = 0; i < specific_univ->town->area_desc.size(); i++) - if(loc.in(specific_univ->town->area_desc[i])) { - loc_str = specific_univ->town->area_desc[i].descr; - } + const std::vector& area_desc = (outdoors ? specific_univ->out->area_desc : specific_univ->town->area_desc); + + loc_str = outdoors ? specific_univ->out->name : specific_univ->town->name; + for(const info_rect_t& area : area_desc){ + if(!area.empty() && loc.in(area)) { + loc_str = area.descr; + } } return loc_str; } diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index dd046eb6..abc94474 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -1448,7 +1448,7 @@ void draw_map(bool need_refresh, std::string tooltip_text) { info_rect_t area = area_desc[i]; rectangle& known_bounds = known_area_rects[i]; // tile is in an area rectangle. see if it extends the party's known bounds of the area - if(area.contains(where) && !is_blocked(real_where, false)){ + if(!area.empty() && area.contains(where) && !is_blocked(real_where, false)){ if(where.x < known_bounds.left) known_bounds.left = where.x; if(where.y < known_bounds.top) known_bounds.top = where.y; if(where.x + 1 > known_bounds.right) known_bounds.right = where.x + 1;