Doors will no longer be pried open once the doafter finishes if they shouldn't. (#23818)

* Fix bug where prying would succeed even a door could no longer be pried.

* Remove redundant call to Resolve

* Remove redundant comment
This commit is contained in:
nikthechampiongr
2024-01-10 00:05:02 +02:00
committed by GitHub
parent ae59b072cc
commit 88045afcf0

View File

@@ -158,10 +158,19 @@ public sealed class PryingSystem : EntitySystem
if (args.Target is null)
return;
PryingComponent? comp = null;
TryComp<PryingComponent>(args.Used, out var comp);
if (args.Used != null && Resolve(args.Used.Value, ref comp))
_audioSystem.PlayPredicted(comp.UseSound, args.Used.Value, args.User);
if (!CanPry(uid, args.User, out var message, comp))
{
if (message != null)
Popup.PopupEntity(Loc.GetString(message), uid, args.User);
return;
}
// 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);