mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Fix access mispredicts when having a remote in hand (#14451)
This commit is contained in:
parent
c9e70d8ea0
commit
f4ccfc5e35
3 changed files with 16 additions and 7 deletions
|
|
@ -1,10 +1,9 @@
|
|||
using Content.Shared.Access.Components;
|
||||
using Content.Server.Access.Components;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.UserInterface;
|
||||
using Robust.Shared.Player;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.Interaction;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Access.Systems
|
||||
|
|
@ -42,11 +41,15 @@ namespace Content.Server.Access.Systems
|
|||
_popupSystem.PopupEntity(Loc.GetString("agent-id-no-new", ("card", args.Target)), args.Target.Value, args.User);
|
||||
return;
|
||||
}
|
||||
else if (addedLength == 1)
|
||||
|
||||
Dirty(access);
|
||||
|
||||
if (addedLength == 1)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("agent-id-new-1", ("card", args.Target)), args.Target.Value, args.User);
|
||||
return;
|
||||
}
|
||||
|
||||
_popupSystem.PopupEntity(Loc.GetString("agent-id-new", ("number", addedLength), ("card", args.Target)), args.Target.Value, args.User);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using System.Linq;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Kitchen.Components;
|
||||
using Content.Server.Popups;
|
||||
|
|
@ -6,10 +7,8 @@ using Content.Shared.Access.Components;
|
|||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Server.Access.Systems
|
||||
{
|
||||
|
|
@ -57,7 +56,10 @@ namespace Content.Server.Access.Systems
|
|||
if (randomPick <= 0.25f)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-bricked", ("id", uid)), uid);
|
||||
|
||||
access.Tags.Clear();
|
||||
Dirty(access);
|
||||
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Microwave)} cleared access on {ToPrettyString(uid):entity}");
|
||||
}
|
||||
|
|
@ -68,7 +70,9 @@ namespace Content.Server.Access.Systems
|
|||
|
||||
// Give them a wonderful new access to compensate for everything
|
||||
var random = _random.Pick(_prototypeManager.EnumeratePrototypes<AccessLevelPrototype>().ToArray());
|
||||
|
||||
access.Tags.Add(random.ID);
|
||||
Dirty(access);
|
||||
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Microwave)} added {random.ID} access to {ToPrettyString(uid):entity}");
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ namespace Content.Shared.Access.Systems
|
|||
continue;
|
||||
|
||||
component.Tags.UnionWith(proto.Tags);
|
||||
Dirty(component);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -111,6 +112,7 @@ namespace Content.Shared.Access.Systems
|
|||
|
||||
access.Tags.Clear();
|
||||
access.Tags.UnionWith(prototype.Access);
|
||||
Dirty(access);
|
||||
|
||||
TryAddGroups(uid, prototype.AccessGroups, access);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue