Inline TryGetComponent completely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:05:23 +01:00
parent f3edecf994
commit 2ff4ec65d5
34 changed files with 98 additions and 84 deletions

View File

@@ -2,6 +2,7 @@ using Content.Server.AI.Components;
using Content.Server.AI.Utility.AiLogic;
using Content.Server.AI.WorldState;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.AI.Utility
{
@@ -9,7 +10,7 @@ namespace Content.Server.AI.Utility
{
public static Blackboard? GetBlackboard(IEntity entity)
{
if (!entity.TryGetComponent(out AiControllerComponent? aiControllerComponent))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out AiControllerComponent? aiControllerComponent))
{
return null;
}