Fix position swapping with QSI and artifacts (#26364)
This commit is contained in:
@@ -145,27 +145,14 @@ public sealed class SwapTeleporterSystem : EntitySystem
|
||||
}
|
||||
|
||||
var teleEnt = GetTeleportingEntity((uid, xform));
|
||||
var teleEntXform = Transform(teleEnt);
|
||||
var otherTeleEnt = GetTeleportingEntity((linkedEnt, Transform(linkedEnt)));
|
||||
var otherTeleEntXform = Transform(otherTeleEnt);
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("swap-teleporter-popup-teleport-other",
|
||||
("entity", Identity.Entity(linkedEnt, EntityManager))),
|
||||
otherTeleEnt,
|
||||
otherTeleEnt,
|
||||
PopupType.MediumCaution);
|
||||
var pos = teleEntXform.Coordinates;
|
||||
var otherPos = otherTeleEntXform.Coordinates;
|
||||
|
||||
if (_transform.ContainsEntity(teleEnt, (otherTeleEnt, otherTeleEntXform)) ||
|
||||
_transform.ContainsEntity(otherTeleEnt, (teleEnt, teleEntXform)))
|
||||
{
|
||||
Log.Error($"Invalid teleport swap attempt between {ToPrettyString(teleEnt)} and {ToPrettyString(otherTeleEnt)}");
|
||||
return;
|
||||
}
|
||||
|
||||
_transform.SetCoordinates(teleEnt, otherPos);
|
||||
_transform.SetCoordinates(otherTeleEnt, pos);
|
||||
_transform.SwapPositions(teleEnt, otherTeleEnt);
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
|
||||
Reference in New Issue
Block a user