Skip to content

Commit

Permalink
Safer min range
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollch committed Nov 21, 2023
1 parent 0054e19 commit 031e4bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/overmapbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,8 +1616,9 @@ bool overmapbuffer::place_special( const overmap_special_id &special_id,
// search using the same radius value we used in placing it.

std::vector<tripoint_om_omt> points_in_range;
for( const tripoint_abs_omt &p : closest_points_first( center, min_radius,
std::max( 1, max_radius - longest_side ) ) ) {
int max = std::max( 1, max_radius - longest_side );
int min = std::min( max, min_radius + longest_side );
for( const tripoint_abs_omt &p : closest_points_first( center, min, max ) ) {
point_abs_om overmap;
tripoint_om_omt omt_within_overmap;
std::tie( overmap, omt_within_overmap ) = project_remain<coords::om>( p );
Expand Down

0 comments on commit 031e4bd

Please sign in to comment.