Skip to content

Commit

Permalink
Fix door access in mapping mode (#30030)
Browse files Browse the repository at this point in the history
Fix shouldn't break anythingTM.
  • Loading branch information
metalgearsloth authored Jul 19, 2024
1 parent 56ee4da commit 6005a9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,11 @@ private void OpenDeviceLinkUi(EntityUid configuratorUid, EntityUid? targetUid, E
if (Delay(configurator))
return;

if (!targetUid.HasValue || !configurator.ActiveDeviceLink.HasValue || !TryComp(userUid, out ActorComponent? actor) || !AccessCheck(targetUid.Value, userUid, configurator))
if (!targetUid.HasValue || !configurator.ActiveDeviceLink.HasValue || !AccessCheck(targetUid.Value, userUid, configurator))
return;


_uiSystem.OpenUi(configuratorUid, NetworkConfiguratorUiKey.Link, actor.PlayerSession);
_uiSystem.OpenUi(configuratorUid, NetworkConfiguratorUiKey.Link, userUid);
configurator.DeviceLinkTarget = targetUid;


Expand Down
7 changes: 6 additions & 1 deletion Content.Shared/Access/Systems/AccessReaderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ public bool IsAllowed(
return IsAllowedInternal(access, stationKeys, reader);

if (!_containerSystem.TryGetContainer(target, reader.ContainerAccessProvider, out var container))
return Paused(target); // when mapping, containers with electronics arent spawned
return false;

// If entity is paused then always allow it at this point.
// Door electronics is kind of a mess but yeah, it should only be an unpaused ent interacting with it
if (Paused(target))
return true;

foreach (var entity in container.ContainedEntities)
{
Expand Down

0 comments on commit 6005a9f

Please sign in to comment.