Check Deleted instead of null for HandTeleporter (#18260)

This commit is contained in:
Vordenburg
2023-07-24 16:21:44 -04:00
committed by GitHub
parent 2298ae92c3
commit 796d818bba

View File

@@ -78,7 +78,7 @@ public sealed class HandTeleporterSystem : EntitySystem
var xform = Transform(user);
// Create the first portal.
if (component.FirstPortal == null && component.SecondPortal == null)
if (Deleted(component.FirstPortal) && Deleted(component.SecondPortal))
{
// don't portal
if (xform.ParentUid != xform.GridUid)
@@ -90,7 +90,7 @@ public sealed class HandTeleporterSystem : EntitySystem
_adminLogger.Add(LogType.EntitySpawn, LogImpact.Low, $"{ToPrettyString(user):player} opened {ToPrettyString(component.FirstPortal.Value)} at {Transform(component.FirstPortal.Value).Coordinates} using {ToPrettyString(uid)}");
_audio.PlayPvs(component.NewPortalSound, uid);
}
else if (component.SecondPortal == null)
else if (Deleted(component.SecondPortal))
{
var timeout = EnsureComp<PortalTimeoutComponent>(user);
timeout.EnteredPortal = null;