- fix: Fix veil shifter crash. (#127)

This commit is contained in:
Aviu00
2024-02-27 15:12:53 +09:00
committed by GitHub
parent 76fa9eb50f
commit aa14dc3a25

View File

@@ -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);