if (!component.Powered || (!overrideAccess && component.IsLocked))
args.Cancel();
+ else if (args.User != null)
+ WarnPlayer((uid, component), args.User.Value);
}
private void OnDoorGetPryTimeModifier(EntityUid uid, FirelockComponent component, ref GetPryTimeModifierEvent args)
{
- if (component.Temperature)
+ WarnPlayer((uid, component), args.User);
+
+ if (component.IsLocked)
+ args.PryTimeModifier *= component.LockedPryTimeModifier;
+ }
+
+ private void WarnPlayer(Entity<FirelockComponent> ent, EntityUid user)
+ {
+ if (ent.Comp.Temperature)
{
_popupSystem.PopupClient(Loc.GetString("firelock-component-is-holding-fire-message"),
- uid, args.User, PopupType.MediumCaution);
+ ent.Owner,
+ user,
+ PopupType.MediumCaution);
}
- else if (component.Pressure)
+ else if (ent.Comp.Pressure)
{
_popupSystem.PopupClient(Loc.GetString("firelock-component-is-holding-pressure-message"),
- uid, args.User, PopupType.MediumCaution);
+ ent.Owner,
+ user,
+ PopupType.MediumCaution);
}
-
- if (component.IsLocked)
- args.PryTimeModifier *= component.LockedPryTimeModifier;
}
private void OnAfterPried(EntityUid uid, FirelockComponent component, ref PriedEvent args)