Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats through skills: stop killing unskilled characters #28685

Merged
merged 1 commit into from Mar 13, 2019

Conversation

Projects
None yet
3 participants
@mlangsdorf
Copy link
Contributor

mlangsdorf commented Mar 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.

stats through skills: stop killing unskilled characters
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.

@mlangsdorf mlangsdorf requested a review from kevingranade Mar 13, 2019

@ZhilkinSerg ZhilkinSerg merged commit 4796bbd into CleverRaven:master Mar 13, 2019

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
gorgon-ghprb Build finished.
Details

@mlangsdorf mlangsdorf deleted the mlangsdorf:sts_fix branch Mar 13, 2019

@kevingranade

This comment has been minimized.

Copy link
Member

kevingranade commented Mar 14, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/game-breaking-issue-with-stats-through-skills-enabled-on-latest-builds/19213/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.