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 potential nullptr crash when crafting #57587

Merged
merged 1 commit into from
May 10, 2022

Conversation

RoyBerube
Copy link
Contributor

Summary

Bugfixes "Fix potential nullptr crash when crafting"

Purpose of change

Fixes #57543
Crafting with furniture that has a bugged pseudo item inside would lead to a nullptr crash. Smoker is especially troublesome because the bugged item(s) cannot be removed.

Describe the solution

Check that ammo pointer exists before using it.

Describe alternatives you've considered

The pseudo items ideally also need to be eradicated as they should not be there. The problem with the smoker is the tile cannot be interacted with other than through the smoker menu; they cannot be removed.

Testing

Crafting with attached save game linked by issue.

Before: any crafting with the smoker caused a crash.

After: crafting with smoker completes with no errors.

Additional context

The bug causing the pseudo items is likely fixed but I am not 100% convinced.

Furniture with a bugged pseudo inside causes problems
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 9, 2022
@dseguin dseguin merged commit 0cc6c7e into CleverRaven:master May 10, 2022
@RoyBerube RoyBerube deleted the crafting-crash branch May 10, 2022 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Game crash when crafting in my base cave, but not elsewhere
2 participants