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

@@ -146,7 +146,13 @@ namespace Content.Client.DoAfter.UI
{
base.FrameUpdate(args);
if (AttachedEntity?.IsValid() != true ||
IEntity? tempQualifier = AttachedEntity;
if (tempQualifier != null)
{
IoCManager.Resolve<IEntityManager>().EntityExists(tempQualifier.Uid);
}
if (RETURNED_VALUE != true ||
!AttachedEntity.TryGetComponent(out DoAfterComponent? doAfterComponent))
{
Visible = false;

View File

@@ -51,7 +51,7 @@ namespace Content.Client.IconSmoothing
// Yes, we updates ALL smoothing entities surrounding us even if they would never smooth with us.
// This is simpler to implement. If you want to optimize it be my guest.
var senderEnt = ev.Sender;
if (senderEnt.IsValid() &&
if (IoCManager.Resolve<IEntityManager>().EntityExists(senderEnt.Uid) &&
_mapManager.TryGetGrid(senderEnt.Transform.GridID, out var grid1) &&
senderEnt.TryGetComponent(out IconSmoothComponent? iconSmooth)
&& iconSmooth.Running)