]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Prevent mice from spilling containers. (#22812)
authorRepo <47093363+Titian3@users.noreply.github.com>
Thu, 21 Dec 2023 10:23:01 +0000 (23:23 +1300)
committerGitHub <noreply@github.com>
Thu, 21 Dec 2023 10:23:01 +0000 (03:23 -0700)
Added component on mouse prototype to prevent spill verb from being added

Content.Server/Fluids/Components/PreventSpillerComponent.cs [new file with mode: 0644]
Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs
Resources/Prototypes/Entities/Mobs/NPCs/animals.yml

diff --git a/Content.Server/Fluids/Components/PreventSpillerComponent.cs b/Content.Server/Fluids/Components/PreventSpillerComponent.cs
new file mode 100644 (file)
index 0000000..37096f1
--- /dev/null
@@ -0,0 +1,7 @@
+namespace Content.Server.Fluids.Components;
+
+[RegisterComponent]
+public sealed partial class PreventSpillerComponent : Component
+{
+
+}
index 78bdfc6d06eef3fcdd8028c2f41fda5351536dc9..e1681d87311f31d15c20a8e3842dbd20f4e0d9e4 100644 (file)
@@ -26,6 +26,7 @@ namespace Content.Server.Fluids.EntitySystems;
 public sealed partial class PuddleSystem
 {
     [Dependency] private readonly OpenableSystem _openable = default!;
+    [Dependency] private readonly IEntityManager _entityManager = default!;
 
     private void InitializeSpillable()
     {
@@ -184,6 +185,10 @@ public sealed partial class PuddleSystem
         if (solution.Volume == FixedPoint2.Zero)
             return;
 
+        if (_entityManager.HasComponent<PreventSpillerComponent>(args.User))
+            return;
+
+
         Verb verb = new()
         {
             Text = Loc.GetString("spill-target-verb-get-data-text")
index 60663785a6b4678d7df06bd72faaaa0df8c6f346..c4f3fccd51a3b257a6d0dd60764b01a40f45837b 100644 (file)
     needsHands: true
   - type: BadFood
   - type: NonSpreaderZombie
+  - type: PreventSpiller
 
 - type: entity
   parent: MobMouse