Rewrite Enter and related activities.

The unit will now path to the nearest adjacent cell, drag inside, do the inner activity, then (if still alive) drag back to its original
location.

This fixes:
 - Mismatch in logic between Enter and MoveAdjacentTo,
   which causes an infinite loop.
 - Building capturing failing from certain directions.
 - Being unable to enter buildings on unpathable tiles.
 - Units being stranded inside a building if the requirements
   for the inner order aren't met.
This commit is contained in:
Paul Chote
2013-04-15 01:50:19 +12:00
parent 8676562d47
commit e76c746b61
10 changed files with 87 additions and 82 deletions

View File

@@ -52,11 +52,8 @@ namespace OpenRA.Mods.RA
{
self.SetTargetLine(Target.FromOrder(order), Color.Red);
var mobile = self.Trait<Mobile>();
self.CancelActivity();
self.QueueActivity(new Enter(order.TargetActor));
self.QueueActivity(new Demolish(order.TargetActor, Info.C4Delay));
self.QueueActivity(mobile.MoveTo(self.Location, 0));
self.QueueActivity(new Enter(order.TargetActor, new Demolish(order.TargetActor, Info.C4Delay)));
}
}