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,5 +1,6 @@
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.UserInterface
{
@@ -7,7 +8,7 @@ namespace Content.Server.UserInterface
{
public static BoundUserInterface? GetUIOrNull(this IEntity entity, object uiKey)
{
return entity.GetComponentOrNull<ServerUserInterfaceComponent>()?.GetBoundUserInterfaceOrNull(uiKey);
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ServerUserInterfaceComponent>(entity.Uid)?.GetBoundUserInterfaceOrNull(uiKey);
}
}
}