Fix a case of minimap area rect spoilers

This commit is contained in:
2025-08-09 15:46:00 -05:00
parent a82ab06523
commit 8b3400624d
3 changed files with 14 additions and 10 deletions

View File

@@ -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;
}
}
}
}

View File

@@ -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);

View File

@@ -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;