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

fix crash with flashlight #40791

Merged
merged 1 commit into from
May 24, 2020
Merged

Conversation

KorGgenT
Copy link
Member

Summary

SUMMARY: None

Purpose of change

fixes a crash when flashlights have no batteries

Describe the solution

if a flashlight has no batteries, ammo_data() returns nullptr. just return early if it has 0 ammo_remaining() instead.

Testing

When testing #40293 this bug popped up on load. i loaded the game again with this fix and it did not crash.

@KorGgenT KorGgenT added <Crash / Freeze> Fatal bug that results in hangs or crashes. <Bugfix> This is a fix for a bug (or closes open issue) labels May 24, 2020
@kevingranade kevingranade merged commit 69ff39a into CleverRaven:master May 24, 2020
@KorGgenT KorGgenT deleted the light-crash branch May 24, 2020 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) <Crash / Freeze> Fatal bug that results in hangs or crashes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants