Skip to content

Commit

Permalink
Prevent fatigue below -20 for weariness threshold
Browse files Browse the repository at this point in the history
Fatigue below the normal minimum (-20, below/at which the character wakes up) was distorting weary_threshold in testing.
  • Loading branch information
actual-nh authored Jan 4, 2021
1 parent e559d90 commit a1db968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5484,7 +5484,7 @@ int Character::weary_threshold() const
const int bmr = base_bmr();
int threshold = bmr * get_option<float>( "WEARY_BMR_MULT" );
// reduce by 1% per 14 points of fatigue after 150 points
threshold *= 1.0f - ( ( fatigue - 150 ) / 1400.0f );
threshold *= 1.0f - ( ( std::max( fatigue, -20 ) - 150 ) / 1400.0f );
// Each 2 points of morale increase or decrease by 1%
threshold *= 1.0f + ( get_morale_level() / 200.0f );
// TODO: Hunger effects this
Expand Down

0 comments on commit a1db968

Please sign in to comment.