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 weird interactions using RefillableSolutionComponent when dumping food in a drain/sink #30016

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luizwritescode
Copy link
Contributor

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 a DumpableSolutionComponent. It gets treated by the PuddleSystem. The problem is that also includes food and drinks.

  • Adds a field to RefillableSolutionComponent that can mark the entity as DeleteOnEmpty when it gets dumped. Only FoodBaseInjectable gets this set to true so it should only affect food

  • Checks if there is an open OpenableComponent before allowing to dump. This fixes dumping closed bottles

Media

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

  • fix: You can no longer dump a closed bottle/container in a drain
  • tweak: Food gets deleted when dumped

@IProduceWidgets
Copy link
Contributor

Relatedly, being able to close chemical jugs at #29413

@thebadman4662
Copy link

Containers that are not food but can neither be opened or closed, can still be drained, yes? Mostly thinking about waterguns and back water tanks for flamethrower payloads.

@luizwritescode
Copy link
Contributor Author

Containers that are not food but can neither be opened or closed, can still be drained, yes?

If the container can neither be opened or closed then it shouldn't have a OpenableComponent, this skips the check and allows it to be drained.

If the container is marked as deleteOnEmpty then it will get deleted when drained but I need to check if the entity is supposed to drop something when getting "consumed" before calling EntitySystem.DeleteEntity() as this will not give you the pie tin back if you drain a pie, etc.

Some checks were not successful

this is an obsolete test that got removed, updating and pushing again will pass all checks

@SlamBamActionman SlamBamActionman added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Nov 14, 2024
@eoineoineoin eoineoineoin added T: Bugfix Type: Bugs and/or bugfixes P3: Standard Priority: Default priority for repository items. S: Needs Review Status: Requires additional reviews before being fully accepted DB: Beginner Friendly Difficulty: Great for beginners. Unambiguous in scope, and explains how to achieve the result. A: General Interactions Area: General in-game interactions that don't relate to another area. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: General Interactions Area: General in-game interactions that don't relate to another area. DB: Beginner Friendly Difficulty: Great for beginners. Unambiguous in scope, and explains how to achieve the result. P3: Standard Priority: Default priority for repository items. S: Needs Review Status: Requires additional reviews before being fully accepted T: Bugfix Type: Bugs and/or bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Food probably shouldn't be able to be wrung into a drain/sink.
5 participants