Inline TryGetComponent completely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:05:23 +01:00
parent f3edecf994
commit 2ff4ec65d5
34 changed files with 98 additions and 84 deletions

View File

@@ -54,7 +54,7 @@ namespace Content.Shared.Movement.EntitySystems
// For stuff like "Moving out of locker" or the likes
if (owner.IsInContainer() &&
(!owner.TryGetComponent(out MobStateComponent? mobState) ||
(!IoCManager.Resolve<IEntityManager>().TryGetComponent(owner.Uid, out MobStateComponent? mobState) ||
mobState.IsAlive()))
{
var relayMoveEvent = new RelayMovementEntityEvent(owner);
@@ -85,7 +85,7 @@ namespace Content.Shared.Movement.EntitySystems
if (ent == null || !IoCManager.Resolve<IEntityManager>().EntityExists(ent.Uid))
return false;
if (!ent.TryGetComponent(out T? comp))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(ent.Uid, out T? comp))
return false;
component = comp;