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 for issue #35067 #35102

Merged
merged 2 commits into from
Oct 28, 2019
Merged

Fix for issue #35067 #35102

merged 2 commits into from
Oct 28, 2019

Conversation

naHrej
Copy link
Contributor

@naHrej naHrej commented Oct 28, 2019

An assert was being thrown while attempting to render information for non-gun weapons in the UI. This was caused by attempting to render ammunition information incorrectly for items that did not contain the ammunition structure. Adding a check for is_gun() before rendering is necessary to prevent the crash.

Summary

SUMMARY: Bugfixes "Game Crash when scrolling over combat knife"

Purpose of change

Fixes #35102
An assert was being thrown while attempting to render information for non-gun weapons in the UI. This was caused by attempting to render ammunition information incorrectly for items that did not contain the ammunition structure. Adding a check for is_gun() before rendering is necessary to prevent the crash.

Describe the solution

Added a check to the rendering code to prevent it trying read and render the missing data.

Testing

Ascertained the location of the error by recreating the bug with the original code, added the check and re-tested. Also checked to make sure that other item types were not incorrectly affected by the change

An assert was being thrown while attempting to render information for non-gun weapons in the UI. This was caused by attempting to render ammunition information incorrectly for items that did not contain the ammunition structure. Adding a check for is_gun() before rendering is necessary to prevent the crash.
@esotericist esotericist added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact labels Oct 28, 2019
@esotericist esotericist self-assigned this Oct 28, 2019
@anothersimulacrum
Copy link
Member

You need to astyle your changes.

@esotericist
Copy link
Contributor

In the future, please make a branch for your changes before submitting them.

Having them in master makes it more difficult for us to work with. (and makes it harder for you to have multiple things in progress at once)

@esotericist
Copy link
Contributor

Fixes #30676

@esotericist esotericist merged commit d452ada into CleverRaven:master Oct 28, 2019
@LetterShapedGlyphs
Copy link
Contributor

So this was treating the symptom but not the cause. Items with the gunmod_data JSON entry are not populating all the fields they used to ever since #34735 . islot_mod is responsible for the ammo_modifier field and is not being populated anymore for anything that isn't of type GUNMOD

@jbytheway
Copy link
Contributor

@karthas077 I just saw your comment regarding this breakage introduced by #34735. I was a little puzzled at the time regarding the interaction between these islots. Do you know whether this underlying issue has since been solved?

@LetterShapedGlyphs
Copy link
Contributor

LetterShapedGlyphs commented Dec 16, 2019

@jbytheway To my knowledge the current feature duplication between those fields is still present, but I went on vacation for almost all of November and am just getting back so I could have missed something.

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) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants