Skip to content

Commit

Permalink
Improved error message (#75350)
Browse files Browse the repository at this point in the history
* Improved error message

* Double spaces demanded
  • Loading branch information
PatrikLundell authored Aug 1, 2024
1 parent 1fd261f commit 348ab84
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2001,26 +2001,26 @@ std::string map::furnname( const tripoint_bub_ms &p )
* to string terrain.id
*/
ter_id map::ter( const tripoint &p ) const
{
return ter( tripoint_bub_ms( p ) );
}
ter_id map::ter( const tripoint_bub_ms &p ) const
{
if( !inbounds( p ) ) {
return ter_str_id::NULL_ID().id();
}

point_sm_ms l;
const submap *const current_submap = unsafe_get_submap_at( tripoint_bub_ms( p ), l );
const submap *const current_submap = unsafe_get_submap_at( p, l );
if( current_submap == nullptr ) {
debugmsg( "Tried to process terrain at (%d,%d) but the submap is not loaded", l.x(), l.y() );
debugmsg( "Tried to process terrain at (%d,%d) of submap of (%d,%d,%d) but the submap is not loaded. my_MAPSIZE: %d",
l.x(), l.y(), p.x(), p.y(), p.z(), my_MAPSIZE );
return ter_str_id::NULL_ID().id();
}

return current_submap->get_ter( l );
}

ter_id map::ter( const tripoint_bub_ms &p ) const
{
return ter( p.raw() );
}

int map::get_map_damage( const tripoint_bub_ms &p ) const
{
if( !inbounds( p ) ) {
Expand Down

0 comments on commit 348ab84

Please sign in to comment.