Inline HasComponent entirely
This commit is contained in:
@@ -6,6 +6,7 @@ using Content.Server.Storage.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.WorldState.States.Clothing
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Content.Server.AI.WorldState.States.Clothing
|
||||
{
|
||||
if (entity.TryGetContainer(out var container))
|
||||
{
|
||||
if (!container.Owner.HasComponent<EntityStorageComponent>())
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<EntityStorageComponent>(container.Owner.Uid))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Storage.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Content.Server.AI.WorldState.States.Inventory
|
||||
@@ -17,7 +18,7 @@ namespace Content.Server.AI.WorldState.States.Inventory
|
||||
public override void SetValue(IEntity? value)
|
||||
{
|
||||
base.SetValue(value);
|
||||
if (value != null && !value.HasComponent<EntityStorageComponent>())
|
||||
if (value != null && !IoCManager.Resolve<IEntityManager>().HasComponent<EntityStorageComponent>(value.Uid))
|
||||
{
|
||||
Logger.Warning("Set LastOpenedStorageState for an entity that doesn't have a storage component");
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.AI.WorldState.States.Mobs
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.AttachedEntity != Owner && player.AttachedEntity.HasComponent<DamageableComponent>())
|
||||
if (player.AttachedEntity != Owner && IoCManager.Resolve<IEntityManager>().HasComponent<DamageableComponent>(player.AttachedEntity.Uid))
|
||||
{
|
||||
result.Add(player.AttachedEntity);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Server.Storage.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.WorldState.States.Nutrition
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Content.Server.AI.WorldState.States.Nutrition
|
||||
{
|
||||
if (entity.TryGetContainer(out var container))
|
||||
{
|
||||
if (!container.Owner.HasComponent<EntityStorageComponent>())
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<EntityStorageComponent>(container.Owner.Uid))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Server.Storage.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.WorldState.States.Nutrition
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Content.Server.AI.WorldState.States.Nutrition
|
||||
{
|
||||
if (entity.TryGetContainer(out var container))
|
||||
{
|
||||
if (!container.Owner.HasComponent<EntityStorageComponent>())
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<EntityStorageComponent>(container.Owner.Uid))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user