Skip to content

Commit aa3773a

Browse files
authored
overmapbuffer::find_camp() still searches an area (#82496)
1 parent 03729eb commit aa3773a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/overmapbuffer.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,11 +1437,14 @@ shared_ptr_fast<npc> overmapbuffer::find_npc_by_unique_id( const std::string &un
14371437

14381438
std::optional<basecamp *> overmapbuffer::find_camp( const point_abs_omt &p )
14391439
{
1440-
const overmap_with_local_coords om_loc = get_existing_om_global( p );
1441-
if( !!om_loc.om ) {
1442-
std::optional<basecamp *> camp = om_loc.om->find_camp( p );
1443-
if( !!camp ) {
1444-
return camp;
1440+
for( auto &it : overmaps ) {
1441+
const point_abs_omt p2( p );
1442+
for( int x2 = p2.x() - 3; x2 < p2.x() + 3; x2++ ) {
1443+
for( int y2 = p2.y() - 3; y2 < p2.y() + 3; y2++ ) {
1444+
if( std::optional<basecamp *> camp = it.second->find_camp( point_abs_omt( x2, y2 ) ) ) {
1445+
return camp;
1446+
}
1447+
}
14451448
}
14461449
}
14471450
return std::nullopt;

0 commit comments

Comments
 (0)