Inline TryGetComponent completely, for real
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Content.Client.Suspicion
|
||||
return false;
|
||||
}
|
||||
|
||||
return _playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out suspicion);
|
||||
return IoCManager.Resolve<IEntityManager>().TryGetComponent(_playerManager.LocalPlayer.ControlledEntity.Uid, out suspicion);
|
||||
}
|
||||
|
||||
public void UpdateLabel()
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Content.Client.Suspicion
|
||||
var viewport = _eyeManager.GetWorldViewport();
|
||||
|
||||
var ent = _playerManager.LocalPlayer?.ControlledEntity;
|
||||
if (ent == null || ent.TryGetComponent(out SuspicionRoleComponent? sus) != true)
|
||||
if (ent == null || IoCManager.Resolve<IEntityManager>().TryGetComponent(ent.Uid, out SuspicionRoleComponent? sus) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace Content.Client.Suspicion
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ally.TryGetComponent(out IPhysBody? physics))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(ally.Uid, out IPhysBody? physics))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user