if (args.Target is null)
return;
- PryingComponent? comp = null;
+ TryComp<PryingComponent>(args.Used, out var comp);
+
+ if (!CanPry(uid, args.User, out var message, comp))
+ {
+ if (message != null)
+ Popup.PopupEntity(Loc.GetString(message), uid, args.User);
+ return;
+ }
- if (args.Used != null && Resolve(args.Used.Value, ref comp))
- _audioSystem.PlayPredicted(comp.UseSound, args.Used.Value, args.User);
+ // TODO: When we get airlock prediction make this predicted.
+ // When that happens also fix the checking function in the Client AirlockSystem.
+ if (args.Used != null && comp != null)
+ _audioSystem.PlayPvs(comp.UseSound, args.Used.Value);
var ev = new PriedEvent(args.User);
RaiseLocalEvent(uid, ref ev);