- fix: Fix veil shifter crash. (#127)
This commit is contained in:
@@ -68,9 +68,10 @@ public sealed class VoidTeleportSystem : EntitySystem
|
|||||||
var oldCoords = transform.Coordinates;
|
var oldCoords = transform.Coordinates;
|
||||||
|
|
||||||
EntityCoordinates coords = default;
|
EntityCoordinates coords = default;
|
||||||
|
var foundTeleportPos = false;
|
||||||
var attempts = 10;
|
var attempts = 10;
|
||||||
//Repeat until proper place for tp is found
|
//Repeat until proper place for tp is found
|
||||||
while (attempts <= 10)
|
while (attempts > 0)
|
||||||
{
|
{
|
||||||
attempts--;
|
attempts--;
|
||||||
//Get coords to where tp
|
//Get coords to where tp
|
||||||
@@ -86,9 +87,13 @@ public sealed class VoidTeleportSystem : EntitySystem
|
|||||||
if (tile != null && _turf.IsTileBlocked(tile.Value, CollisionGroup.AllMask))
|
if (tile != null && _turf.IsTileBlocked(tile.Value, CollisionGroup.AllMask))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
foundTeleportPos = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!foundTeleportPos)
|
||||||
|
return;
|
||||||
|
|
||||||
CreatePulse(uid, component);
|
CreatePulse(uid, component);
|
||||||
|
|
||||||
_xform.SetCoordinates(args.User, coords);
|
_xform.SetCoordinates(args.User, coords);
|
||||||
|
|||||||
Reference in New Issue
Block a user