Skip to content

Commit

Permalink
Add function to check if location was from special
Browse files Browse the repository at this point in the history
  • Loading branch information
ralreegorganon committed Dec 12, 2018
1 parent b67e1b7 commit c0b1641
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) ) {
Expand Down
1 change: 1 addition & 0 deletions src/overmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c0b1641

Please sign in to comment.