Fix capturing etc

This commit is contained in:
Paul Chote
2011-02-05 18:13:30 +13:00
parent 4b0ab1c461
commit de26b63fd2
2 changed files with 3 additions and 3 deletions

View File

@@ -308,7 +308,7 @@ namespace OpenRA.Mods.RA.Move
}
}
public SubCell GetDesiredSubcell(int2 a)
public SubCell GetDesiredSubcell(int2 a, Actor ignoreActor)
{
if (!Info.SharesCell)
return SubCell.FullCell;
@@ -317,7 +317,7 @@ namespace OpenRA.Mods.RA.Move
return new[]{ __fromSubCell, SubCell.TopLeft, SubCell.TopRight, SubCell.Center,
SubCell.BottomLeft, SubCell.BottomRight}.First(b =>
{
var blockingActors = uim.GetUnitsAt(a,b);
var blockingActors = uim.GetUnitsAt(a,b).Where(c => c != ignoreActor);
if (blockingActors.Count() > 0)
{
// Non-sharable unit can enter a cell with shareable units only if it can crush all of them

View File

@@ -229,7 +229,7 @@ namespace OpenRA.Mods.RA.Move
hasWaited = false;
path.RemoveAt( path.Count - 1 );
var subCell = mobile.GetDesiredSubcell(nextCell);
var subCell = mobile.GetDesiredSubcell(nextCell, ignoreBuilding);
return Pair.New(nextCell, subCell);
}