Inline GetComponentOrNull

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:32:05 +01:00
parent ee4ff9cfe8
commit 2654775bf0
30 changed files with 55 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
using Content.Server.Chemistry.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Chemistry.ReactionEffects
@@ -11,7 +12,7 @@ namespace Content.Server.Chemistry.ReactionEffects
{
protected override SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity)
{
return entity.GetComponentOrNull<FoamSolutionAreaEffectComponent>();
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<FoamSolutionAreaEffectComponent>(entity.Uid);
}
}
}

View File

@@ -1,6 +1,7 @@
using Content.Server.Chemistry.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Chemistry.ReactionEffects
@@ -11,7 +12,7 @@ namespace Content.Server.Chemistry.ReactionEffects
{
protected override SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity)
{
return entity.GetComponentOrNull<SmokeSolutionAreaEffectComponent>();
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<SmokeSolutionAreaEffectComponent>(entity.Uid);
}
}
}