fix #1205 -- desync when AI builds harvs

This commit is contained in:
Chris Forbes
2011-10-14 08:24:45 +13:00
parent 770cdf38b6
commit d202f9627f
2 changed files with 6 additions and 4 deletions

View File

@@ -249,8 +249,7 @@ namespace OpenRA.Mods.RA
{
BotDebug("AI: Found a newly built unit");
if (a.Info == Rules.Info["harv"])
a.QueueActivity(new FindResources());
world.IssueOrder( new Order( "Harvest", a, false ) );
else
unitsHangingAroundTheBase.Add(a);

View File

@@ -154,9 +154,12 @@ namespace OpenRA.Mods.RA
{
var mobile = self.Trait<Mobile>();
self.CancelActivity();
self.QueueActivity(mobile.MoveTo(order.TargetLocation, 0));
if (order.TargetLocation != int2.Zero)
{
self.QueueActivity(mobile.MoveTo(order.TargetLocation, 0));
self.SetTargetLine(Target.FromOrder(order), Color.Red);
}
self.QueueActivity(new FindResources());
self.SetTargetLine(Target.FromOrder(order), Color.Red);
}
else if (order.OrderString == "Deliver")
{