Got rid of some IEntities

This commit is contained in:
Wrexbe
2021-12-03 11:15:41 -08:00
parent f5b8bb3731
commit e2d7ea6f62
7 changed files with 81 additions and 83 deletions

View File

@@ -1,4 +1,4 @@
using Content.Client.Ghost.UI;
using Content.Client.Ghost.UI;
using Content.Client.HUD;
using Content.Shared.Ghost;
using JetBrains.Annotations;
@@ -36,7 +36,7 @@ namespace Content.Client.Ghost
foreach (var ghost in EntityManager.GetAllComponents(typeof(GhostComponent), true))
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(ghost.Owner, out SpriteComponent? sprite))
if (EntityManager.TryGetComponent(ghost.OwnerUid, out SpriteComponent? sprite))
{
sprite.Visible = value;
}
@@ -60,7 +60,7 @@ namespace Content.Client.Ghost
private void OnGhostInit(EntityUid uid, GhostComponent component, ComponentInit args)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SpriteComponent? sprite))
if (EntityManager.TryGetComponent(component.OwnerUid, out SpriteComponent? sprite))
{
sprite.Visible = GhostVisibility;
}
@@ -101,10 +101,10 @@ namespace Content.Client.Ghost
private void OnGhostWarpsResponse(GhostWarpsResponseEvent msg)
{
var entity = _playerManager.LocalPlayer?.ControlledEntity;
var entity = _playerManager.LocalPlayer?.ControlledEntity?.Uid;
if (entity == null ||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out GhostComponent? ghost))
!EntityManager.TryGetComponent(entity.Value, out GhostComponent? ghost))
{
return;
}