-
Notifications
You must be signed in to change notification settings - Fork 281
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: putrid heart is now consumed after use #5493
base: main
Are you sure you want to change the base?
Conversation
} else if( !used.is_craft() && ( used.is_medication() || used.is_food() || | ||
used.get_contained().is_food() || | ||
used.get_contained().is_medication() ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit worried on implications on this, probably need to learn why it had !used.type->has_use()
first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's there to catch a case where an item can be either 'a'pplied or 'e'aten, and is meant to have a different effect depending on which one you do. I can't think of any items that would apply to, though. I tested this with the internal furnace CBM, and that's apparently handled elsewhere, because it still works normally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Petfood is the only item I can recall that has different effects when applied vs eaten.
How goes this PR? Any blockers to merge? |
Only thing evidently is needing to test whether the code change commented on above causes any problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took a while for me to remember to test this.
- Compiled and load-tested.
- Spawned in and tested using putrid heart, it mutates you as expected when eaten or when activated.
- Tested dog food, it still works when activated or eaten.
- Tested regular mutagen and serum, they work when consumed, but serum no longer works when activated.
So, this seems to have broken an item I wasn't expecting to be broken, but didn't affect the item I was expecting to break.
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Optional
Purpose of change
Fixes #5481
Describe the solution
Adjusts the use_item function in avatar_functions.cpp, so that it doesn't check if the item doesn't have an use AND is either food or med to consume it, instead it just checks if it's food or med.
Describe alternatives you've considered
Adding a bunch of jank on Character::invoke_item.
Testing
I tested with a bunch of items like the putrid heart, mutated leg, mutated arm, mutated fetus, and some unrelated items. It seems to work ok without breaking anything?
Plus I think the only food or drink item that has an external use_action (meant to be used on another creature) is the pet food and that's already handled by the two cases above the line changed. Correct me if I'm wrong.