MCPcopy Create free account
hub / github.com/CleverRaven/Cataclysm-DDA / is_bashable

Method is_bashable

src/map.cpp:2590–2608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2588// 3D bashable
2589
2590bool map::is_bashable( const tripoint &p, const bool allow_floor ) const
2591{
2592 if( !inbounds( p ) ) {
2593 DebugLog( D_WARNING, D_MAP ) << "Looking for out-of-bounds is_bashable at "
2594 << p.x << ", " << p.y << ", " << p.z;
2595 return false;
2596 }
2597
2598 if( veh_at( p ).obstacle_at_part() ) {
2599 return true;
2600 }
2601
2602 if( has_furn( p ) && furn( p ).obj().bash.str_max != -1 ) {
2603 return true;
2604 }
2605
2606 const auto &ter_bash = ter( p ).obj().bash;
2607 return ter_bash.str_max != -1 && ( !ter_bash.bash_below || allow_floor );
2608}
2609
2610bool map::is_bashable_ter( const tripoint &p, const bool allow_floor ) const
2611{

Callers 7

pickaxe_finishMethod · 0.45
growplantsMethod · 0.45
move_toMethod · 0.45
fling_creatureMethod · 0.45
mx_helicopterFunction · 0.45
burned_ground_parserFunction · 0.45
smashFunction · 0.45

Calls 1

obstacle_at_partMethod · 0.80

Tested by

no test coverage detected