Fix: Water Bottles Verb Priority and Prediction (#39482)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
68eb43f0d8
commit
450ff99bac
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user