fixed PlaceBuilding and Chronosphere ordergenerators
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user