From 8b3400624d0c4f66bbbe115d4a04a6760d6363da Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 9 Aug 2025 15:46:00 -0500 Subject: [PATCH] Fix a case of minimap area rect spoilers --- src/game/boe.locutils.cpp | 18 ++++++++++-------- src/game/boe.locutils.hpp | 2 +- src/game/boe.town.cpp | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/game/boe.locutils.cpp b/src/game/boe.locutils.cpp index bc3bf436..a27cdfbe 100644 --- a/src/game/boe.locutils.cpp +++ b/src/game/boe.locutils.cpp @@ -260,14 +260,14 @@ void update_explored(const location dest) { // All purpose function to check is spot is free for travel into. -bool is_blocked(location to_check) { +bool is_blocked(location to_check, bool count_party) { if(is_out()) { if(!univ.out.is_on_map(to_check.x, to_check.y)) return true; if(impassable(univ.out[to_check.x][to_check.y])) { return true; } - if(to_check == univ.party.out_loc) + if(count_party && to_check == univ.party.out_loc) return true; for(short i = 0; i < univ.party.out_c.size(); i++) if((univ.party.out_c[i].exists)) @@ -294,12 +294,14 @@ bool is_blocked(location to_check) { // Note: The purpose of the above check is to avoid portals. // Party there? - if(is_town() && to_check == univ.party.town_loc) - return true; - if(is_combat()) { - for(short i = 0; i < 6; i++) { - if(univ.party[i].main_status == eMainStatus::ALIVE && to_check == univ.party[i].combat_pos) { - return true; + if(count_party){ + if(is_town() && to_check == univ.party.town_loc) + return true; + if(is_combat()) { + for(short i = 0; i < 6; i++) { + if(univ.party[i].main_status == eMainStatus::ALIVE && to_check == univ.party[i].combat_pos) { + return true; + } } } } diff --git a/src/game/boe.locutils.hpp b/src/game/boe.locutils.hpp index 3adcfb3a..6778042a 100644 --- a/src/game/boe.locutils.hpp +++ b/src/game/boe.locutils.hpp @@ -24,7 +24,7 @@ short combat_obscurity(short x,short y); ter_num_t coord_to_ter(short x,short y); bool is_container(location loc); void update_explored(location dest); -bool is_blocked(location to_check); +bool is_blocked(location to_check, bool count_party = true); bool monst_can_be_there(location loc,short m_num); bool monst_adjacent(location loc,short m_num); bool monst_can_see(short m_num,location l); diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index a2a048c3..82c35373 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -1443,10 +1443,12 @@ void draw_map(bool need_refresh, std::string tooltip_text) { } for(int i = 0; i < area_desc.size(); ++i){ + location real_where = where; + if(is_out()) real_where = local_to_global(where); 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)){ + if(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;