From 126e200e2e7b6de943080cb59ddf8832581ce305 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 8 Jan 2011 16:08:05 +1300 Subject: [PATCH] fix chronoshift/shroud interaction desync --- OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs index 06955181d9..bb17efa383 100755 --- a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs @@ -51,13 +51,13 @@ namespace OpenRA.Mods.RA { var cs = target.Trait(); var targetCell = target.Location + order.TargetLocation - order.ExtraLocation; - // TODO: Fix CanChronoshiftTo desync - if (cs.CanChronoshiftTo(target, targetCell)) - target.Trait().Teleport(target, - targetCell, - (Info as ChronoshiftPowerInfo).Duration * 25, - (Info as ChronoshiftPowerInfo).KillCargo, - self); + // TODO: CanChronoshiftTo() can't be used in synced code, but not checking this here + // leaves it open to exploitation. + // if (cs.CanChronoshiftTo(target, targetCell)) ... + + var cpi = Info as ChronoshiftPowerInfo; + cs.Teleport(target, targetCell, + cpi.Duration * 25, cpi.KillCargo, self); } }