Fix popup messages appearing when someone tries to open a door without a tool. (#21099)

* The fixTM

* typo fix

* addressing review
This commit is contained in:
nikthechampiongr
2023-10-27 02:26:52 +00:00
committed by GitHub
parent 7a0759f2c0
commit 8f181b4534
4 changed files with 38 additions and 18 deletions

View File

@@ -23,11 +23,15 @@ public abstract class SharedDoorBoltSystem : EntitySystem
private void OnDoorPry(EntityUid uid, DoorBoltComponent component, ref BeforePryEvent args)
{
if (component.BoltsDown && !args.Force)
{
Popup.PopupEntity(Loc.GetString("airlock-component-cannot-pry-is-bolted-message"), uid, args.User);
args.Cancelled = true;
}
if (args.Cancelled)
return;
if (!component.BoltsDown || args.Force)
return;
args.Message = "airlock-component-cannot-pry-is-bolted-message";
args.Cancelled = true;
}
private void OnBeforeDoorOpened(EntityUid uid, DoorBoltComponent component, BeforeDoorOpenedEvent args)