From de26b63fd2bbb5d3c176e6cbe9a98ddcebc80f56 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 5 Feb 2011 18:13:30 +1300 Subject: [PATCH] Fix capturing etc --- OpenRA.Mods.RA/Move/Mobile.cs | 4 ++-- OpenRA.Mods.RA/Move/Move.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index 01476b22c1..f685b96804 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -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 diff --git a/OpenRA.Mods.RA/Move/Move.cs b/OpenRA.Mods.RA/Move/Move.cs index a201daac76..90a8ed7cf3 100755 --- a/OpenRA.Mods.RA/Move/Move.cs +++ b/OpenRA.Mods.RA/Move/Move.cs @@ -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); }