fixed PlaceBuilding and Chronosphere ordergenerators

This commit is contained in:
Bob
2010-10-03 07:42:41 +13:00
committed by Paul Chote
parent aebef4f1c8
commit 3209da4a4a
3 changed files with 29 additions and 6 deletions

View File

@@ -32,7 +32,13 @@ namespace OpenRA.Mods.RA.Orders
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
return InnerOrder(world, xy, mi);
var ret = InnerOrder( world, xy, mi ).ToList();
foreach( var order in ret )
{
world.CancelInputMode();
break;
}
return ret;
}
IEnumerable<Order> InnerOrder(World world, int2 xy, MouseInput mi)

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA
if (order.OrderString == "ChronosphereSelect" && self.Owner == self.World.LocalPlayer)
{
self.World.OrderGenerator = new SelectDestination(order.TargetActor);
//self.World.OrderGenerator = new SelectDestination(order.TargetActor);
}
if (order.OrderString == "ChronosphereActivate")
@@ -60,7 +60,13 @@ namespace OpenRA.Mods.RA
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
return OrderInner(world, xy, mi);
var ret = OrderInner( world, xy, mi ).ToList();
foreach( var order in ret )
{
world.OrderGenerator = new SelectDestination(order.TargetActor);
break;
}
return ret;
}
IEnumerable<Order> OrderInner(World world, int2 xy, MouseInput mi)
@@ -109,11 +115,19 @@ namespace OpenRA.Mods.RA
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
var ret = OrderInner( world, xy, mi ).ToList();
foreach( var order in ret )
{
world.CancelInputMode();
yield break;
break;
}
return ret;
}
IEnumerable<Order> OrderInner(World world, int2 xy, MouseInput mi)
{
// Cannot chronoshift into unexplored location
if (world.LocalPlayer.Shroud.IsExplored(xy))
yield return new Order("ChronosphereActivate", world.LocalPlayer.PlayerActor, self, xy);

View File

@@ -75,8 +75,11 @@ namespace OpenRA.Mods.RA
&& a.HasTrait<IronCurtainable>()
&& a.HasTrait<Selectable>()).FirstOrDefault();
if (underCursor != null)
yield return new Order("IronCurtain", underCursor.Owner.PlayerActor, underCursor);
if( underCursor != null )
{
world.CancelInputMode();
yield return new Order( "IronCurtain", underCursor.Owner.PlayerActor, underCursor );
}
}
yield break;