diff --git a/src/bionics.cpp b/src/bionics.cpp index cb66c7d45e9b8..26c312a4c2ac9 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -1174,9 +1174,7 @@ bool Character::activate_bionic( bionic &bio, bool eff_only, bool *close_bionics } } bio_flag_cache.clear(); - // Recalculate stats (strength, mods from pain etc.) that could have been affected calc_encumbrance(); - reset(); // Also reset crafting inventory cache if this bionic spawned a fake item if( bio.has_weapon() || !bio.info().passive_pseudo_items.empty() || @@ -1272,9 +1270,7 @@ bool Character::deactivate_bionic( bionic &bio, bool eff_only ) } } - // Recalculate stats (strength, mods from pain etc.) that could have been affected calc_encumbrance(); - reset(); if( !bio.id->enchantments.empty() ) { recalculate_enchantment_cache(); } diff --git a/src/character.h b/src/character.h index 2e0c6ffc232a3..0ef70a84cb1d9 100644 --- a/src/character.h +++ b/src/character.h @@ -1541,16 +1541,12 @@ class Character : public Creature, public visitable bool made_of_any( const std::set &ms ) const override; private: - /** Retrieves a stat mod of a mutation. */ - int get_mod( const trait_id &mut, const std::string &arg ) const; /** Applies skill-based boosts to stats **/ void apply_skill_boost(); protected: void on_move( const tripoint_abs_ms &old_pos ) override; void do_skill_rust(); - /** Applies stat mods to character. */ - void apply_mods( const trait_id &mut, bool add_remove ); /** Applies encumbrance from mutations and bionics only */ void mut_cbm_encumb( std::map &vals ) const; diff --git a/src/mutation.cpp b/src/mutation.cpp index a6fef23a36699..086b41cffadd1 100644 --- a/src/mutation.cpp +++ b/src/mutation.cpp @@ -444,32 +444,6 @@ bool reflex_activation_data::is_trigger_true( Character &guy ) const return trigger( d ); } -int Character::get_mod( const trait_id &mut, const std::string &arg ) const -{ - const auto &mod_data = mut->mods; - int ret = 0; - auto found = mod_data.find( std::make_pair( false, arg ) ); - if( found != mod_data.end() ) { - ret += found->second; - } - return ret; -} - -void Character::apply_mods( const trait_id &mut, bool add_remove ) -{ - int sign = add_remove ? 1 : -1; - int str_change = get_mod( mut, "STR" ); - str_max += sign * str_change; - per_max += sign * get_mod( mut, "PER" ); - dex_max += sign * get_mod( mut, "DEX" ); - int_max += sign * get_mod( mut, "INT" ); - - reset_stats(); - if( str_change != 0 ) { - recalc_hp(); - } -} - bool mutation_branch::conflicts_with_item( const item &it ) const { if( allow_soft_gear && it.is_soft() ) { @@ -575,9 +549,8 @@ void Character::mutation_effect( const trait_id &mut, const bool worn_destroyed_ { if( mut == trait_GLASSJAW ) { recalc_hp(); - } else { - apply_mods( mut, true ); } + reset(); recalculate_size(); @@ -655,9 +628,8 @@ void Character::mutation_loss_effect( const trait_id &mut ) { if( mut == trait_GLASSJAW ) { recalc_hp(); - } else { - apply_mods( mut, false ); } + reset(); recalculate_size(); @@ -997,8 +969,6 @@ void Character::deactivate_mutation( const trait_id &mut ) my_mutations[mut].powered = false; trait_flag_cache.clear(); - // Handle stat changes from deactivation - apply_mods( mut, false ); recalc_sight_limits(); const mutation_branch &mdata = mut.obj(); if( mdata.transform ) { diff --git a/src/mutation.h b/src/mutation.h index 7f83978484377..cc1690037dab1 100644 --- a/src/mutation.h +++ b/src/mutation.h @@ -351,9 +351,6 @@ struct mutation_branch { std::set remove_rigid_subparts; // item flags that allow wearing gear even if its body part is restricted std::set allowed_items; - // Mutation stat mods - /** Key pair is */ - std::unordered_map, int, cata::tuple_hash> mods; std::map armor; // Modifiers to protection values std::vector integrated_armor; // Armor pseudo-items that are put on by this mutation std::vector