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 when displaying weapon name #55500

Merged
merged 1 commit into from
Feb 20, 2022

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Feb 19, 2022

Summary

None

Purpose of change

Fixes #55490.
Fixes #55505.
Minor regression from #55377. There's a null dereference when displaying the weapon name for a gunmod that also acts as a gun (ex: underslung shotgun).

Describe the solution

Check if the current mode is invalid, and use the weapon's display name instead.

Describe alternatives you've considered

Gunmods should probably have a mode set by default, but "DEFAULT" isn't valid on gunmods because it would conflict with the parent gun's default mode.

Testing

Tested by spawning a few items and checking the weapon name. Switched modes on the M4 to make sure the changes from #55377 are still working. Also crafted the underslung shotgun to check that the case in the linked issue is fixed as well.

m4_semi
m4_auto
underslung_shot
longbow

Additional context

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Feb 19, 2022
@Maleclypse Maleclypse added <Bugfix> This is a fix for a bug (or closes open issue) Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons labels Feb 19, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 19, 2022
@kevingranade kevingranade merged commit edb9f92 into CleverRaven:master Feb 20, 2022
@dseguin dseguin deleted the handle_gunmod_name branch February 20, 2022 20:25
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) Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on crafting modified M203 crafting underslung shotgun crashing game
3 participants