From b519525bb3b249f708ae0e6f249e14875f0e5fce Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Thu, 9 Nov 2023 07:45:26 -0600 Subject: [PATCH] Revert "[CR] Bashing furniture/terrain gradually gets easier" --- src/map.cpp | 41 +---------------------------------------- src/map.h | 3 --- src/submap.h | 16 ---------------- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 45611bcdaa620..f3a0b6b623ca5 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1890,36 +1890,6 @@ 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 ) ) { - return 0; - } - - point_sm_ms l; - const submap *const current_submap = unsafe_get_submap_at( p, l ); - if( current_submap == nullptr ) { - debugmsg( "Called get_map_damage for unloaded submap" ); - return 0; - } - return current_submap->get_map_damage( l ); -} - -void map::set_map_damage( const tripoint_bub_ms &p, int dmg ) -{ - if( !inbounds( p ) ) { - return; - } - - point_sm_ms l; - submap *const current_submap = unsafe_get_submap_at( p, l ); - if( current_submap == nullptr ) { - debugmsg( "Called set_map_damage for unloaded submap" ); - return; - } - return current_submap->set_map_damage( l, dmg ); -} - uint8_t map::get_known_connections( const tripoint &p, const std::bitset &connect_group, const std::map &override ) const @@ -4001,18 +3971,9 @@ void map::bash_ter_furn( const tripoint &p, bash_params ¶ms ) } // Linear interpolation from str_min to str_max const int resistance = smin + ( params.roll * ( smax - smin ) ); - // Semi-persistant map damage. Increment by one for each bash over smin - // Gradually makes hard bashes easier - int damage = get_map_damage( tripoint_bub_ms( p ) ); - add_msg_debug( debugmode::DF_MAP, "Bashing diff. %d to %d, roll %g. Strength is %d + %d vs %d", - smin, smax, params.roll, params.strength, damage, resistance ); - if( params.strength + damage >= resistance ) { - damage = 0; + if( params.strength >= resistance ) { success = true; - } else if( params.strength >= smin ) { - damage += 1; } - set_map_damage( tripoint_bub_ms( p ), damage ); } if( smash_furn ) { diff --git a/src/map.h b/src/map.h index c1a746e143417..967c9c88ac44c 100644 --- a/src/map.h +++ b/src/map.h @@ -809,9 +809,6 @@ class map return ter( tripoint( p, abs_sub.z() ) ); } - int get_map_damage( const tripoint_bub_ms &p ) const; - void set_map_damage( const tripoint_bub_ms &p, int dmg ); - // Return a bitfield of the adjacent tiles which connect to the given // connect_group. From least-significant bit the order is south, east, // west, north (because that's what cata_tiles expects). diff --git a/src/submap.h b/src/submap.h index 96fa0b798bdc3..d4e6073557d04 100644 --- a/src/submap.h +++ b/src/submap.h @@ -123,17 +123,6 @@ class submap ensure_nonuniform(); std::uninitialized_fill_n( &m->frn[0][0], elements, furn ); } - int get_map_damage( const point_sm_ms &p ) const { - auto it = ephemeral_data.find( p ); - if( it != ephemeral_data.end() ) { - return it->second.damage; - } - return 0; - } - - void set_map_damage( const point_sm_ms &p, int dmg ) { - ephemeral_data[p] = { dmg }; - } ter_id get_ter( const point &p ) const { if( is_uniform() ) { @@ -305,12 +294,7 @@ class submap std::map partial_constructions; std::unique_ptr camp; // only allowing one basecamp per submap - struct tile_data { - int damage; - }; - private: - std::map ephemeral_data; std::map computers; std::unique_ptr legacy_computer; std::unique_ptr m;