From e70b61c4b07b23ac25d1b0aca1bb587b2b2a179d Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 31 Dec 2017 10:48:19 +0000 Subject: [PATCH] Fix Chrono Tanks telesporting towards (0,0) when force-moving to an actor. --- OpenRA.Mods.Cnc/Traits/PortableChrono.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Cnc/Traits/PortableChrono.cs b/OpenRA.Mods.Cnc/Traits/PortableChrono.cs index f459095fbc..c5d584bcf1 100644 --- a/OpenRA.Mods.Cnc/Traits/PortableChrono.cs +++ b/OpenRA.Mods.Cnc/Traits/PortableChrono.cs @@ -95,11 +95,13 @@ namespace OpenRA.Mods.Cnc.Traits public void ResolveOrder(Actor self, Order order) { - if (order.OrderString == "PortableChronoTeleport" && CanTeleport) + if (order.OrderString == "PortableChronoTeleport" && CanTeleport && order.Target.Type != TargetType.Invalid) { var maxDistance = Info.HasDistanceLimit ? Info.MaxDistance : (int?)null; self.CancelActivity(); - self.QueueActivity(new Teleport(self, order.TargetLocation, maxDistance, Info.KillCargo, Info.FlashScreen, Info.ChronoshiftSound)); + + var cell = self.World.Map.CellContaining(order.Target.CenterPosition); + self.QueueActivity(new Teleport(self, cell, maxDistance, Info.KillCargo, Info.FlashScreen, Info.ChronoshiftSound)); } }