From 418b45d41d62a575d7fa83553daf30fc73501fb5 Mon Sep 17 00:00:00 2001 From: Jamuro-g <76928284+Jamuro-g@users.noreply.github.com> Date: Thu, 20 May 2021 22:04:44 +0200 Subject: [PATCH] Fix removed depressant&stim cap (#47831) * removed depressant&stim cap --- src/consumption.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/consumption.cpp b/src/consumption.cpp index 916aeca94a988..e88fbe8b2a16a 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -1033,15 +1033,15 @@ void Character::modify_health( const islot_comestible &comest ) void Character::modify_stimulation( const islot_comestible &comest ) { + if( comest.stim == 0 ) { + return; + } const int current_stim = get_stim(); - if( comest.stim != 0 && - ( std::abs( current_stim ) < ( std::abs( comest.stim ) * 3 ) || - sgn( current_stim ) != sgn( comest.stim ) ) ) { - if( comest.stim < 0 ) { - set_stim( std::max( comest.stim * 3, current_stim + comest.stim ) ); - } else { - set_stim( std::min( comest.stim * 3, current_stim + comest.stim ) ); - } + if( ( std::abs( comest.stim ) * 3 ) > std::abs( current_stim ) ) { + mod_stim( comest.stim ); + } else { + comest.stim > 0 ? mod_stim( std::max( comest.stim / 2, 1 ) ) : mod_stim( std::min( comest.stim / 2, + -1 ) ); } if( has_trait( trait_STIMBOOST ) && ( current_stim > 30 ) && ( ( comest.add == add_type::CAFFEINE ) || ( comest.add == add_type::SPEED ) ||