Inline HasComponent entirely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 12:23:18 +01:00
parent 88141ae6b8
commit 0feebbff00
117 changed files with 201 additions and 158 deletions

View File

@@ -4,6 +4,7 @@ using System.Linq;
using Content.Server.Access.Components;
using Content.Server.Doors.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
@@ -260,7 +261,7 @@ namespace Content.Server.AI.Pathfinding
public void AddEntity(IEntity entity, IPhysBody physicsComponent)
{
// If we're a door
if (entity.HasComponent<AirlockComponent>() || entity.HasComponent<ServerDoorComponent>())
if (IoCManager.Resolve<IEntityManager>().HasComponent<AirlockComponent>(entity.Uid) || IoCManager.Resolve<IEntityManager>().HasComponent<ServerDoorComponent>(entity.Uid))
{
// If we need access to traverse this then add to readers, otherwise no point adding it (except for maybe tile costs in future)
// TODO: Check for powered I think (also need an event for when it's depowered