From ad087d4e61d43937237c044fe0965079b1f29140 Mon Sep 17 00:00:00 2001 From: Eric Pierce Date: Wed, 19 Feb 2020 20:17:40 -0700 Subject: [PATCH] Don't penalize strong characters for dragging One of the changes introduced in PR #37787 dropped the conditional check for character strength being *equal* to exertion required, and instead applied the "It takes some time" movement penalty to everyone (regardless of strength). And, due to the first `if` being changed to `ex >= u.get_str() + 1`, there was no case for `ex == u.get_str()`, allowing characters with a very specific strength, just 1 less than the strength needed, to avoid any movement penalty at all. Fixes #38104 The pain penalty is preserved (with comment), and a narrower condition (potentially matching 2 different strength stat values) gives the "It takes some time" message with the same movement penalty. Any character with sufficient (or more than sufficient) strength to drag the vehicle will see no message and receive no additional movement penalty. --- src/grab.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/grab.cpp b/src/grab.cpp index c0f748d979053..b05149633b8cb 100644 --- a/src/grab.cpp +++ b/src/grab.cpp @@ -121,12 +121,14 @@ bool game::grabbed_veh_move( const tripoint &dp ) u.moves -= 100 * str_req / std::max( 1, u.get_str() ); const int ex = dice( 1, 3 ) - 1 + str_req; if( ex > u.get_str() + 1 ) { + // Pain and movement penalty if exertion exceeds character strength add_msg( m_bad, _( "You strain yourself to move the %s!" ), grabbed_vehicle->name ); u.moves -= 200; u.mod_pain( 1 ); - } else { - u.moves -= 200; + } else if( ex >= u.get_str() ) { + // Movement is slow if exertion nearly equals character strength add_msg( _( "It takes some time to move the %s." ), grabbed_vehicle->name ); + u.moves -= 200; } } else { u.moves -= 100;