Inline IsValid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:32:53 +01:00
parent 1b13e5e0ec
commit 2d130e31d6
8 changed files with 17 additions and 11 deletions

View File

@@ -191,7 +191,7 @@ namespace Content.Server.Hands.Systems
var playerEnt = playerSession.AttachedEntity;
if (playerEnt == null || !playerEnt.IsValid())
if (playerEnt == null || !IoCManager.Resolve<IEntityManager>().EntityExists(playerEnt.Uid))
return false;
return playerEnt.TryGetComponent(out hands);
@@ -221,7 +221,7 @@ namespace Content.Server.Hands.Systems
var playerEnt = playerSession.AttachedEntity;
if (playerEnt == null ||
!playerEnt.IsValid() ||
!IoCManager.Resolve<IEntityManager>().EntityExists(playerEnt.Uid) ||
playerEnt.IsInContainer() ||
!playerEnt.TryGetComponent(out SharedHandsComponent? hands) ||
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
@@ -269,7 +269,7 @@ namespace Content.Server.Hands.Systems
var plyEnt = playerSession.AttachedEntity;
if (plyEnt == null || !plyEnt.IsValid())
if (plyEnt == null || !IoCManager.Resolve<IEntityManager>().EntityExists(plyEnt.Uid))
return;
if (!plyEnt.TryGetComponent(out SharedHandsComponent? hands) ||