From aa14dc3a258cb00b877d088b39dcc2523d1d84e3 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:12:53 +0900 Subject: [PATCH] - fix: Fix veil shifter crash. (#127) --- .../_White/Cult/Items/Systems/VoidTeleportSystem.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Content.Server/_White/Cult/Items/Systems/VoidTeleportSystem.cs b/Content.Server/_White/Cult/Items/Systems/VoidTeleportSystem.cs index 75a5a33d7b..353c4d7f10 100644 --- a/Content.Server/_White/Cult/Items/Systems/VoidTeleportSystem.cs +++ b/Content.Server/_White/Cult/Items/Systems/VoidTeleportSystem.cs @@ -68,9 +68,10 @@ public sealed class VoidTeleportSystem : EntitySystem var oldCoords = transform.Coordinates; EntityCoordinates coords = default; + var foundTeleportPos = false; var attempts = 10; //Repeat until proper place for tp is found - while (attempts <= 10) + while (attempts > 0) { attempts--; //Get coords to where tp @@ -86,9 +87,13 @@ public sealed class VoidTeleportSystem : EntitySystem if (tile != null && _turf.IsTileBlocked(tile.Value, CollisionGroup.AllMask)) continue; + foundTeleportPos = true; break; } + if (!foundTeleportPos) + return; + CreatePulse(uid, component); _xform.SetCoordinates(args.User, coords);