Fix: Water Bottles Verb Priority and Prediction (#39482)

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-08-09 12:31:34 -07:00
committed by GitHub
parent 68eb43f0d8
commit 450ff99bac
2 changed files with 8 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ using Content.Shared.Interaction.Components;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
using Content.Shared.Storage; using Content.Shared.Storage;
using Content.Shared.Weapons.Ranged.Systems;
namespace Content.Shared.Nutrition.EntitySystems; namespace Content.Shared.Nutrition.EntitySystems;
@@ -117,7 +118,10 @@ public sealed partial class IngestionSystem
private void OnOpenableEdible(Entity<OpenableComponent> ent, ref EdibleEvent args) 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; args.Cancelled = true;
} }

View File

@@ -104,7 +104,7 @@ public sealed partial class OpenableSystem : EntitySystem
Text = Loc.GetString(comp.CloseVerbText), Text = Loc.GetString(comp.CloseVerbText),
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/close.svg.192dpi.png")), Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/close.svg.192dpi.png")),
Act = () => TryClose(args.Target, comp, args.User), Act = () => TryClose(args.Target, comp, args.User),
// this verb is lower priority than drink verb (2) so it doesn't conflict Priority = 3
}; };
} }
else else
@@ -113,7 +113,8 @@ public sealed partial class OpenableSystem : EntitySystem
{ {
Text = Loc.GetString(comp.OpenVerbText), Text = Loc.GetString(comp.OpenVerbText),
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/open.svg.192dpi.png")), 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); args.Verbs.Add(verb);