Fix a case of minimap area rect spoilers
This commit is contained in:
@@ -260,14 +260,14 @@ void update_explored(const location dest) {
|
|||||||
|
|
||||||
|
|
||||||
// All purpose function to check is spot is free for travel into.
|
// 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(is_out()) {
|
||||||
if(!univ.out.is_on_map(to_check.x, to_check.y))
|
if(!univ.out.is_on_map(to_check.x, to_check.y))
|
||||||
return true;
|
return true;
|
||||||
if(impassable(univ.out[to_check.x][to_check.y])) {
|
if(impassable(univ.out[to_check.x][to_check.y])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(to_check == univ.party.out_loc)
|
if(count_party && to_check == univ.party.out_loc)
|
||||||
return true;
|
return true;
|
||||||
for(short i = 0; i < univ.party.out_c.size(); i++)
|
for(short i = 0; i < univ.party.out_c.size(); i++)
|
||||||
if((univ.party.out_c[i].exists))
|
if((univ.party.out_c[i].exists))
|
||||||
@@ -294,6 +294,7 @@ bool is_blocked(location to_check) {
|
|||||||
// Note: The purpose of the above check is to avoid portals.
|
// Note: The purpose of the above check is to avoid portals.
|
||||||
|
|
||||||
// Party there?
|
// Party there?
|
||||||
|
if(count_party){
|
||||||
if(is_town() && to_check == univ.party.town_loc)
|
if(is_town() && to_check == univ.party.town_loc)
|
||||||
return true;
|
return true;
|
||||||
if(is_combat()) {
|
if(is_combat()) {
|
||||||
@@ -303,6 +304,7 @@ bool is_blocked(location to_check) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Monster there?
|
// Monster there?
|
||||||
if(univ.target_there(to_check, TARG_MONST))
|
if(univ.target_there(to_check, TARG_MONST))
|
||||||
|
@@ -24,7 +24,7 @@ short combat_obscurity(short x,short y);
|
|||||||
ter_num_t coord_to_ter(short x,short y);
|
ter_num_t coord_to_ter(short x,short y);
|
||||||
bool is_container(location loc);
|
bool is_container(location loc);
|
||||||
void update_explored(location dest);
|
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_can_be_there(location loc,short m_num);
|
||||||
bool monst_adjacent(location loc,short m_num);
|
bool monst_adjacent(location loc,short m_num);
|
||||||
bool monst_can_see(short m_num,location l);
|
bool monst_can_see(short m_num,location l);
|
||||||
|
@@ -1443,10 +1443,12 @@ void draw_map(bool need_refresh, std::string tooltip_text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < area_desc.size(); ++i){
|
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];
|
info_rect_t area = area_desc[i];
|
||||||
rectangle& known_bounds = known_area_rects[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
|
// 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.x < known_bounds.left) known_bounds.left = where.x;
|
||||||
if(where.y < known_bounds.top) known_bounds.top = where.y;
|
if(where.y < known_bounds.top) known_bounds.top = where.y;
|
||||||
if(where.x + 1 > known_bounds.right) known_bounds.right = where.x + 1;
|
if(where.x + 1 > known_bounds.right) known_bounds.right = where.x + 1;
|
||||||
|
Reference in New Issue
Block a user