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

@@ -178,11 +178,16 @@ public sealed class AirlockSystem : SharedAirlockSystem
private void OnBeforePry(EntityUid uid, AirlockComponent component, ref BeforePryEvent args)
{
if (this.IsPowered(uid, EntityManager) && !args.PryPowered)
{
Popup.PopupEntity(Loc.GetString("airlock-component-cannot-pry-is-powered-message"), uid, args.User);
args.Cancelled = true;
}
if (args.Cancelled)
return;
if (!this.IsPowered(uid, EntityManager) || args.PryPowered)
return;
args.Message = "airlock-component-cannot-pry-is-powered-message";
args.Cancelled = true;
}
public bool CanChangeState(EntityUid uid, AirlockComponent component)