filtering of unusable cells in minefield support; rationalize mobile a bit

This commit is contained in:
Chris Forbes
2010-05-23 16:07:59 +12:00
parent 9dd1032683
commit 027d7e2c2b
2 changed files with 12 additions and 19 deletions

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
class Minelayer : IIssueOrder, IResolveOrder
{
int2[] minefield = null;
public int2[] minefield = null;
int2 minefieldStart; /* nosync! */
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
@@ -60,8 +60,11 @@ namespace OpenRA.Mods.RA
if (self.Owner == self.World.LocalPlayer)
Game.controller.CancelInputMode();
var movement = self.traits.Get<IMovement>();
minefield = GetMinefieldCells(minefieldStart, order.TargetLocation,
self.Info.Traits.Get<MinelayerInfo>().MinefieldDepth).ToArray();
self.Info.Traits.Get<MinelayerInfo>().MinefieldDepth)
.Where(p => movement.CanEnterCell(p)).ToArray();
/* todo: start the mnly actually laying mines there */
}