Fix opening wire panels without WiresPanelSecurityComponent (#20798)
This commit is contained in:
@@ -152,10 +152,12 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
|||||||
{
|
{
|
||||||
if (TryComp<WiresPanelComponent>(uid, out var panel) &&
|
if (TryComp<WiresPanelComponent>(uid, out var panel) &&
|
||||||
panel.Open &&
|
panel.Open &&
|
||||||
TryComp<WiresPanelSecurityComponent>(uid, out var wiresPanelSecurity) &&
|
|
||||||
wiresPanelSecurity.WiresAccessible &&
|
|
||||||
TryComp<ActorComponent>(args.User, out var actor))
|
TryComp<ActorComponent>(args.User, out var actor))
|
||||||
{
|
{
|
||||||
|
if (TryComp<WiresPanelSecurityComponent>(uid, out var wiresPanelSecurity) &&
|
||||||
|
!wiresPanelSecurity.WiresAccessible)
|
||||||
|
return;
|
||||||
|
|
||||||
_wiresSystem.OpenUserInterface(uid, actor.PlayerSession);
|
_wiresSystem.OpenUserInterface(uid, actor.PlayerSession);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -463,11 +463,13 @@ public sealed class WiresSystem : SharedWiresSystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (panel.Open &&
|
if (panel.Open &&
|
||||||
TryComp<WiresPanelSecurityComponent>(uid, out var wiresPanelSecurity) &&
|
|
||||||
wiresPanelSecurity.WiresAccessible &&
|
|
||||||
(_toolSystem.HasQuality(args.Used, "Cutting", tool) ||
|
(_toolSystem.HasQuality(args.Used, "Cutting", tool) ||
|
||||||
_toolSystem.HasQuality(args.Used, "Pulsing", tool)))
|
_toolSystem.HasQuality(args.Used, "Pulsing", tool)))
|
||||||
{
|
{
|
||||||
|
if (TryComp<WiresPanelSecurityComponent>(uid, out var wiresPanelSecurity) &&
|
||||||
|
!wiresPanelSecurity.WiresAccessible)
|
||||||
|
return;
|
||||||
|
|
||||||
if (TryComp(args.User, out ActorComponent? actor))
|
if (TryComp(args.User, out ActorComponent? actor))
|
||||||
{
|
{
|
||||||
_uiSystem.TryOpen(uid, WiresUiKey.Key, actor.PlayerSession);
|
_uiSystem.TryOpen(uid, WiresUiKey.Key, actor.PlayerSession);
|
||||||
|
|||||||
Reference in New Issue
Block a user