Inline GetAllComponents

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:42:24 +01:00
parent e0fe09cb46
commit f10ed6c0c3
18 changed files with 48 additions and 38 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections.Generic;
using Content.Shared.Item;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Items
{
@@ -10,7 +12,7 @@ namespace Content.Server.Items
{
public override void RemovedFromSlot()
{
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<ISpriteRenderableComponent>(Owner.Uid))
{
component.Visible = true;
}
@@ -18,7 +20,7 @@ namespace Content.Server.Items
public override void EquippedToSlot()
{
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents<ISpriteRenderableComponent>(Owner.Uid))
{
component.Visible = false;
}