Fix weird interactions using RefillableSolutionComponent when dumping food in a drain/sink #30016
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 PR
Fixes #29937
You can no longer dump closed bottles/containers in a drain/sink.
Most importantly this patches exploitable interactions when food gets dumped into a drain/sink by transfering the solution and then deleting the entity.
Why / Balance
Currently you cannot draw from a food's solution but you CAN dump it in a drain and have a bugged "empty" food. For the most part this only means that when you try to eat it, it will just disappear from your hand with no sound and pop a "{Food} is empty!" message. But then nothing stops someone from dumping an Arnold's pizza and filling it with poison and at this point I don't even know if that's a fun gimmick or an exploit. The point is the idea of a food being empty doesn't make sense. There should be better ways to fill up food with deadly doses than through using a drain.
Also, being able to dump a closed bottle is just weird
Technical details
Currently there is a weird thing that happens when drag dropping entities with a
RefillableSolutionComponent
to a entity with aDumpableSolutionComponent
. It gets treated by thePuddleSystem
. The problem is that also includes food and drinks.Adds a field to
RefillableSolutionComponent
that can mark the entity asDeleteOnEmpty
when it gets dumped. OnlyFoodBaseInjectable
gets this set to true so it should only affect foodChecks if there is an open
OpenableComponent
before allowing to dump. This fixes dumping closed bottlesMedia
Before:
destroy-food-on-dump-old.mp4
After:
destroy-food-on-dump.mp4
Breaking changes
any food that usually drops a byproduct when eaten (kebabs) is getting deleted and so nothing drops
Changelog
🆑 coffeeware