Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upFix segfault on using spillable comestibles (aluminum cans/tin cans) #25098
Conversation
alanbrady
force-pushed the
alanbrady:fix-spillable-comestible
branch
Aug 24, 2018
alanbrady
force-pushed the
alanbrady:fix-spillable-comestible
branch
to
4953282
Aug 24, 2018
kevingranade
merged commit 85e47ed
into
CleverRaven:master
Aug 24, 2018
alanbrady
referenced this pull request
Aug 24, 2018
Closed
Pot duplicates after crafting clean water #25110
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
alanbrady commentedAug 24, 2018
•
edited
Summary
SUMMARY: Bugfixes "Fix drinking from 'aluminum can' segfault and fix tin cans more"
Purpose of change
PR #25017 broke using aluminum cans and caused a duplication bug when eating from tin cans from inventory.
Inventory/item code is hard.
Describe the solution
This fixes it by adjusting the placement of the call to handle_spillable_contents() to a more appropriate place in the flow of consuming an item. We also check if handle_spillable_content handled our comestible or not. If it did we need to remove it from inventory.
This also fixes a small issue in usability where if you:
User should expect to see another dialog box asking them what to do about the rest of the soup instead of just defaulting to put it on the ground for the remaining portions. This, however was actually a preexisting issue if you tried to put a spillable bucket in a vehicle and chose 'Consume It', the same behavior is observed and the same fix will fix them both.
Additional context
The original issue attempted to be treated here is when eating from a vehicle, the item just gets spilled on the ground instead of handled gracefully. See #18168