]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix: Water Bottles Verb Priority and Prediction (#39482)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Sat, 9 Aug 2025 19:31:34 +0000 (12:31 -0700)
committerGitHub <noreply@github.com>
Sat, 9 Aug 2025 19:31:34 +0000 (12:31 -0700)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Nutrition/EntitySystems/IngestionSystem.Blockers.cs
Content.Shared/Nutrition/EntitySystems/OpenableSystem.cs

index e1bd480bccb953e17629297dc4c3073e8bc0a44e..3e7c9da12229e4c6410ccc77c884b3669866d6dc 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Interaction.Components;
 using Content.Shared.Inventory;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Storage;
+using Content.Shared.Weapons.Ranged.Systems;
 
 namespace Content.Shared.Nutrition.EntitySystems;
 
@@ -117,7 +118,10 @@ public sealed partial class IngestionSystem
 
     private void OnOpenableEdible(Entity<OpenableComponent> ent, ref EdibleEvent args)
     {
-        if (_openable.IsClosed(ent, args.User, ent.Comp))
+        if (args.Cancelled)
+            return;
+
+        if (_openable.IsClosed(ent, args.User, ent.Comp, predicted: true))
             args.Cancelled = true;
     }
 
index 588875d5533a9210bbe1c8a8d48fe88156b9001c..04d3c20a3fcce32b33ea02043e711f65480e1c45 100644 (file)
@@ -104,7 +104,7 @@ public sealed partial class OpenableSystem : EntitySystem
                 Text = Loc.GetString(comp.CloseVerbText),
                 Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/close.svg.192dpi.png")),
                 Act = () => TryClose(args.Target, comp, args.User),
-                // this verb is lower priority than drink verb (2) so it doesn't conflict
+                Priority = 3
             };
         }
         else
@@ -113,7 +113,8 @@ public sealed partial class OpenableSystem : EntitySystem
             {
                 Text = Loc.GetString(comp.OpenVerbText),
                 Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/open.svg.192dpi.png")),
-                Act = () => TryOpen(args.Target, comp, args.User)
+                Act = () => TryOpen(args.Target, comp, args.User),
+                Priority = 3
             };
         }
         args.Verbs.Add(verb);