Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upstats through skills: stop killing unskilled characters #28685
Conversation
mlangsdorf
added
<Crash / Freeze>
Mods
[C++]
<Bugfix>
labels
Mar 13, 2019
mlangsdorf
requested a review
from
kevingranade
Mar 13, 2019
ZhilkinSerg
merged commit 4796bbd
into
CleverRaven:master
Mar 13, 2019
mlangsdorf
deleted the
mlangsdorf:sts_fix
branch
Mar 13, 2019
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
mlangsdorf commentedMar 13, 2019
Summary
SUMMARY: Bugfixes "stats through skills: stop killing unskilled characters"Purpose of change
Fixes #28680
Stats through skills, the non-LUA version, was returning NaN for characters with less than 3 points in Str skills. That then put their max HP at extremely negative numbers, killing them.
Describe the solution
std::pow does weird things when the base is less than 0, so just return 0 if the sum of skill bonus and the _offset is less than 0 instead of doing math and getting NaN results.
Describe alternatives you've considered
I really just want to fix this and get back to doing other things.