From 420012f8d98fcdaefcdf642a81f4de6c0bb24dd4 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 21 Dec 2009 20:09:19 -0800 Subject: [PATCH] Unhack movement check in ChronoshiftDeploy (well, hide the hack under another layer of abstraction, at least) --- OpenRa.Game/Traits/ChronoshiftDeploy.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRa.Game/Traits/ChronoshiftDeploy.cs b/OpenRa.Game/Traits/ChronoshiftDeploy.cs index 2839fd0b18..d88dc9da6a 100644 --- a/OpenRa.Game/Traits/ChronoshiftDeploy.cs +++ b/OpenRa.Game/Traits/ChronoshiftDeploy.cs @@ -1,5 +1,7 @@ using OpenRa.Game.GameRules; using System.Collections.Generic; +using System.Linq; + namespace OpenRa.Game.Traits { class ChronoshiftDeploy : IOrder, ISpeedModifier, ITick, IPips @@ -30,13 +32,14 @@ namespace OpenRa.Game.Traits public void ResolveOrder(Actor self, Order order) { + var movement = self.traits.WithInterface().FirstOrDefault(); if (order.OrderString == "ActivatePortableChronoshift" && remainingChargeTime <= 0) { chronoshiftActive = true; self.CancelActivity(); } - if (order.OrderString == "UsePortableChronoshift" && Game.IsCellBuildable(order.TargetLocation, self.Info.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel, self)) + if (order.OrderString == "UsePortableChronoshift" && movement.CanEnterCell(order.TargetLocation)) { self.CancelActivity(); self.QueueActivity(new Activities.Teleport(order.TargetLocation));