Fixed hard hat user inventory head icon #5216
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the pull request
In the recent PR #5189 the action item for the hard hat was fixed. However because the icon was being turned on in hand instead of on head, it was overlooked that the user inventory head icon was also incorrect at times, specifically when turned on while the user is wearing it. This PR is related to the previous change mentioned because the
update_icon
call must occur first, due to the fact that bothupdate_button_icon
andupdate_inv_head
both reference the icon and item state properties.Explain why it's good for the game
It is desirable for the icon state to be consistent in all situations. We want the light icon to show as shining when light is being emitted.
Testing Photographs and Procedure
This update was tested both in hand and on head, as well as off states. The bug is reliably observable when the hard hat is activated while on head, however when in hand and placed on head in the on state, the bug does not occur. Upon various testing I have been unable to cause the icon to be in an inconsistent state.
Screenshots & Videos
Before
After
Changelog
🆑
fix: Fixed hard hat user inventory head icon
/:cl: