Change pricingsystem a bit (#14470)

This commit is contained in:
metalgearsloth
2023-03-24 15:27:55 +11:00
committed by GitHub
parent 303506fc38
commit 377f473ced
4 changed files with 177 additions and 76 deletions

View File

@@ -27,7 +27,7 @@ public sealed class PriceGunSystem : EntitySystem
private void OnUtilityVerb(EntityUid uid, PriceGunComponent component, GetVerbsEvent<UtilityVerb> args)
{
if (!args.CanAccess || !args.CanInteract || args.Target == null)
if (!args.CanAccess || !args.CanInteract)
return;
if (TryComp(args.Using, out UseDelayComponent? useDelay) && useDelay.ActiveDelay)
@@ -50,7 +50,7 @@ public sealed class PriceGunSystem : EntitySystem
}
private void OnAfterInteract(EntityUid uid, PriceGunComponent component, AfterInteractEvent args)
{
if (!args.CanReach || args.Target == null)
if (!args.CanReach || args.Target == null || args.Handled)
return;
if (TryComp(args.Used, out UseDelayComponent? useDelay) && useDelay.ActiveDelay)
@@ -60,5 +60,6 @@ public sealed class PriceGunSystem : EntitySystem
_popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target.Value, EntityManager)), ("price", $"{price:F2}")), args.User, args.User);
_useDelay.BeginDelay(uid, useDelay);
args.Handled = true;
}
}