fixed order canceling

This commit is contained in:
Chris Forbes
2009-10-24 20:41:38 +13:00
parent 0956748116
commit f6ae86bb53
2 changed files with 8 additions and 2 deletions

View File

@@ -30,7 +30,8 @@ namespace OpenRa.Game
{ {
if (Game.LocalPlayer == Unit.Owner) if (Game.LocalPlayer == Unit.Owner)
Game.PlaySound("ackno.r00", false); Game.PlaySound("ackno.r00", false);
var mobile = Unit.traits.Get<Traits.Mobile>(); var mobile = Unit.traits.Get<Traits.Mobile>();
mobile.Cancel(Unit);
mobile.QueueAction( new Traits.Mobile.MoveTo( Destination ) ); mobile.QueueAction( new Traits.Mobile.MoveTo( Destination ) );
} }
} }

View File

@@ -55,8 +55,13 @@ namespace OpenRa.Game.Traits
return new MoveOrder(self, xy); return new MoveOrder(self, xy);
return null; return null;
}
public void Cancel(Actor self)
{
if (currentAction != null)
currentAction.Cancel(self, this);
} }
public interface CurrentAction public interface CurrentAction
{ {