From 7deb22e1634554bb22eef6ff1ea271f1c2f6cb15 Mon Sep 17 00:00:00 2001 From: corentt <36075110+corentt@users.noreply.github.com> Date: Sun, 14 Aug 2022 07:19:45 +0200 Subject: [PATCH] Fix cans that cant be spilled (#10529) --- Content.Server/Fluids/EntitySystems/SpillableSystem.cs | 3 +++ .../Entities/Objects/Consumable/Drinks/drinks_cans.yml | 2 ++ .../Entities/Objects/Consumable/Drinks/drinks_special.yml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/Content.Server/Fluids/EntitySystems/SpillableSystem.cs b/Content.Server/Fluids/EntitySystems/SpillableSystem.cs index 3b84f28253..c455809f22 100644 --- a/Content.Server/Fluids/EntitySystems/SpillableSystem.cs +++ b/Content.Server/Fluids/EntitySystems/SpillableSystem.cs @@ -95,6 +95,9 @@ public sealed class SpillableSystem : EntitySystem { if (!_solutionContainerSystem.TryGetSolution(uid, component.SolutionName, out var solution)) return; + if (TryComp(uid, out var drink) && (!drink.Opened)) + return; + if (args.User != null) { _adminLogger.Add(LogType.Landed, diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml index 1063457725..e4d1663d87 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml @@ -34,6 +34,8 @@ - type: DrinkCanVisualizer stateClosed: icon stateOpen: icon_open + - type: Spillable + solution: drink - type: ItemCooldown - type: Recyclable - type: SpaceGarbage diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_special.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_special.yml index 504ec48104..56744e95c7 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_special.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_special.yml @@ -18,6 +18,8 @@ solution: drink - type: SolutionTransfer canChangeTransferAmount: true + - type: Spillable + solution: drink - type: Sprite sprite: Objects/Consumable/Drinks/shaker.rsi state: icon