Inline IsValid
This commit is contained in:
@@ -201,7 +201,7 @@ namespace Content.Server.Cargo.Components
|
||||
|
||||
private void UpdateUIState()
|
||||
{
|
||||
if (_bankAccount == null || !Owner.IsValid())
|
||||
if (_bankAccount == null || !IoCManager.Resolve<IEntityManager>().EntityExists(Owner.Uid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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) ||
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Content.Server.Interaction
|
||||
|
||||
userEntity = ((IPlayerSession?) session)?.AttachedEntity;
|
||||
|
||||
if (userEntity == null || !userEntity.IsValid())
|
||||
if (userEntity == null || !IoCManager.Resolve<IEntityManager>().EntityExists(userEntity.Uid))
|
||||
{
|
||||
Logger.WarningS("system.interaction",
|
||||
$"Client sent interaction with no attached entity. Session={session}");
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
var attachedEntity = session.AttachedEntity;
|
||||
|
||||
// The component manages the set of sessions, so this invalid session should be removed soon.
|
||||
if (attachedEntity == null || !attachedEntity.IsValid())
|
||||
if (attachedEntity == null || !IoCManager.Resolve<IEntityManager>().EntityExists(attachedEntity.Uid))
|
||||
continue;
|
||||
|
||||
if (storageMap != attachedEntity.Transform.MapID)
|
||||
|
||||
Reference in New Issue
Block a user