fix some fail desyncs in chronoshift code

This commit is contained in:
Chris Forbes
2010-05-26 19:02:43 +12:00
parent e7b7f69caf
commit 270941cfde
5 changed files with 8 additions and 13 deletions

View File

@@ -149,12 +149,12 @@ namespace OpenRA.Traits
queue.RemoveAt(0);
}
public void BeginProduction( string group, ProductionItem item )
void BeginProduction( string group, ProductionItem item )
{
production[group].Add(item);
}
public void BuildUnit( string name )
void BuildUnit( string name )
{
var newUnitType = Rules.Info[ name ];
var producerTypes = Rules.TechTree.UnitBuiltAt( newUnitType );

View File

@@ -67,10 +67,6 @@ namespace OpenRA.Mods.Aftermath
var movement = self.traits.GetOrDefault<IMovement>();
if (order.OrderString == "ChronoshiftSelf" && movement.CanEnterCell(order.TargetLocation))
{
// Cannot chronoshift into unexplored location
if (!self.Owner.Shroud.IsExplored(order.TargetLocation))
return;
if (self.Owner == self.World.LocalPlayer)
Game.controller.CancelInputMode();

View File

@@ -41,6 +41,7 @@ namespace OpenRA.Mods.Aftermath.Orders
yield break;
}
if (world.LocalPlayer.Shroud.IsExplored(xy))
yield return new Order("ChronoshiftSelf", self, xy);
}

View File

@@ -51,10 +51,6 @@ namespace OpenRA.Mods.RA
if (self.Owner == self.World.LocalPlayer)
Game.controller.CancelInputMode();
// Cannot chronoshift into unexplored location
if (!self.Owner.Shroud.IsExplored(order.TargetLocation))
return;
// Ensure the target cell is valid for the unit
var movement = order.TargetActor.traits.GetOrDefault<IMovement>();
if (!movement.CanEnterCell(order.TargetLocation))
@@ -147,6 +143,8 @@ namespace OpenRA.Mods.RA
yield break;
}
// Cannot chronoshift into unexplored location
if (world.LocalPlayer.Shroud.IsExplored(xy))
yield return new Order("ChronosphereActivate", world.LocalPlayer.PlayerActor, self, xy);
}

View File

@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using System.Drawing.Imaging;
namespace OpenRA.TilesetBuilder
{