Fix IDE0019

This commit is contained in:
RoosterDragon
2023-02-19 10:07:30 +00:00
committed by Pavel Penev
parent 80bb828fe5
commit 6d7c73d498
4 changed files with 6 additions and 9 deletions

View File

@@ -146,11 +146,10 @@ namespace OpenRA.Mods.Cnc.Traits
minefieldStart = order.ExtraLocation;
var movement = self.Trait<IPositionable>();
var mobile = movement as Mobile;
var minefield = GetMinefieldCells(minefieldStart, cell, Info.MinefieldDepth)
.Where(c => IsCellAcceptable(self, c) && self.Owner.Shroud.IsExplored(c)
&& movement.CanEnterCell(c, null, BlockedByActor.Immovable) && (mobile != null && mobile.CanStayInCell(c)))
&& movement.CanEnterCell(c, null, BlockedByActor.Immovable) && (movement is Mobile mobile && mobile.CanStayInCell(c)))
.OrderBy(c => (c - minefieldStart).LengthSquared).ToList();
self.QueueActivity(order.Queued, new LayMines(self, minefield));