Fix access on vehicles, mechs (#14458)
This commit is contained in:
@@ -250,13 +250,13 @@ namespace Content.Shared.Access.Systems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool FindAccessTagsItem(EntityUid uid, [NotNullWhen(true)] out HashSet<string>? tags)
|
private bool FindAccessTagsItem(EntityUid uid, [NotNullWhen(true)] out HashSet<string>? tags)
|
||||||
{
|
{
|
||||||
if (EntityManager.TryGetComponent(uid, out AccessComponent? access))
|
if (TryComp(uid, out AccessComponent? access))
|
||||||
{
|
{
|
||||||
tags = access.Tags;
|
tags = access.Tags;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(uid, out PDAComponent? pda) &&
|
if (TryComp(uid, out PDAComponent? pda) &&
|
||||||
pda.ContainedID?.Owner is {Valid: true} id)
|
pda.ContainedID?.Owner is {Valid: true} id)
|
||||||
{
|
{
|
||||||
tags = EntityManager.GetComponent<AccessComponent>(id).Tags;
|
tags = EntityManager.GetComponent<AccessComponent>(id).Tags;
|
||||||
@@ -273,7 +273,7 @@ namespace Content.Shared.Access.Systems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool FindStationRecordKeyItem(EntityUid uid, [NotNullWhen(true)] out StationRecordKey? key)
|
private bool FindStationRecordKeyItem(EntityUid uid, [NotNullWhen(true)] out StationRecordKey? key)
|
||||||
{
|
{
|
||||||
if (EntityManager.TryGetComponent(uid, out StationRecordKeyStorageComponent? storage) && storage.Key != null)
|
if (TryComp(uid, out StationRecordKeyStorageComponent? storage) && storage.Key != null)
|
||||||
{
|
{
|
||||||
key = storage.Key;
|
key = storage.Key;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public abstract class SharedMechSystem : EntitySystem
|
|||||||
|
|
||||||
args.Entities.Add(pilot.Value);
|
args.Entities.Add(pilot.Value);
|
||||||
_access.FindAccessItemsInventory(pilot.Value, out var items);
|
_access.FindAccessItemsInventory(pilot.Value, out var items);
|
||||||
args.Entities = args.Entities.Union(items).ToHashSet();
|
args.Entities.UnionWith(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupUser(EntityUid mech, EntityUid pilot, SharedMechComponent? component = null)
|
private void SetupUser(EntityUid mech, EntityUid pilot, SharedMechComponent? component = null)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System.Linq;
|
|
||||||
using Content.Shared.Access.Components;
|
using Content.Shared.Access.Components;
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
using Content.Shared.Vehicle.Components;
|
using Content.Shared.Vehicle.Components;
|
||||||
@@ -12,8 +11,6 @@ using Robust.Shared.Serialization;
|
|||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using Content.Shared.Audio;
|
using Content.Shared.Audio;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
|
||||||
using Content.Shared.Inventory;
|
|
||||||
|
|
||||||
namespace Content.Shared.Vehicle;
|
namespace Content.Shared.Vehicle;
|
||||||
|
|
||||||
@@ -192,7 +189,7 @@ public abstract partial class SharedVehicleSystem : EntitySystem
|
|||||||
|
|
||||||
args.Entities.Add(rider);
|
args.Entities.Add(rider);
|
||||||
_access.FindAccessItemsInventory(rider, out var items);
|
_access.FindAccessItemsInventory(rider, out var items);
|
||||||
args.Entities = args.Entities.Union(items).ToHashSet();
|
args.Entities.UnionWith(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user