diff --git a/src/overmap.cpp b/src/overmap.cpp index 17ca4440dc8dd..f7fd871db187c 100644 --- a/src/overmap.cpp +++ b/src/overmap.cpp @@ -2988,6 +2988,21 @@ bool overmap::check_ot_subtype( const std::string &otype, int x, int y, int z ) return is_ot_subtype( otype.c_str(), oter ); } +bool overmap::check_overmap_special_type( const overmap_special_id &id, int x, int y, int z ) const +{ + // Try and find the special associated with this location. + const tripoint location( x, y, z ); + auto found_id = overmap_special_placements.find( location ); + + // There was no special here, so bail. + if( found_id == overmap_special_placements.end() ) { + return false; + } + + // Return whether the found special was a match with our requested id. + return found_id->second == id; +} + void overmap::good_river( int x, int y, int z ) { if( !is_ot_type( "river", get_ter( x, y, z ) ) ) { diff --git a/src/overmap.h b/src/overmap.h index 2226cb3b244ae..8431dd1c01f22 100644 --- a/src/overmap.h +++ b/src/overmap.h @@ -351,6 +351,7 @@ class overmap // Polishing bool check_ot_type( const std::string &otype, int x, int y, int z ) const; bool check_ot_subtype( const std::string &otype, int x, int y, int z ) const; + bool check_overmap_special_type( const overmap_special_id &id, int x, int y, int z ) const; void chip_rock( int x, int y, int z ); void polish_river();