diff --git a/OpenRa.Game/PathFinder.cs b/OpenRa.Game/PathFinder.cs index 76c0c469bc..54b050fe11 100644 --- a/OpenRa.Game/PathFinder.cs +++ b/OpenRa.Game/PathFinder.cs @@ -72,8 +72,8 @@ namespace OpenRa.Game continue; if (Game.BuildingInfluence.GetBuildingAt(newHere - offset) != null) continue; - if (Game.UnitInfluence.GetUnitAt(newHere - offset) != null) - continue; + //if (Game.UnitInfluence.GetUnitAt(newHere - offset) != null) + // continue; double cellCost = ( ( d.X * d.Y != 0 ) ? 1.414213563 : 1.0 ) * passableCost[(int)umt][ newHere.X, newHere.Y ]; double newCost = cellInfo[ here.X, here.Y ].MinCost + cellCost; diff --git a/OpenRa.Game/Traits/Mobile.cs b/OpenRa.Game/Traits/Mobile.cs index b69ce493ee..1cc2c5abe5 100644 --- a/OpenRa.Game/Traits/Mobile.cs +++ b/OpenRa.Game/Traits/Mobile.cs @@ -160,7 +160,10 @@ namespace OpenRa.Game.Traits if( firstFacing != mobile.facing ) mobile.currentAction = new Turn( firstFacing ) { NextAction = this }; else - { + { + var unitAtDest = Game.UnitInfluence.GetUnitAt(nextCell); + if ( unitAtDest != null && unitAtDest != self ) + return; /* todo: repath, sometimes */ mobile.toCell = nextCell; path.RemoveAt( path.Count - 1 ); moveFractionTotal = ( dir.X != 0 && dir.Y != 0 ) ? 35 : 25; @@ -169,7 +172,9 @@ namespace OpenRa.Game.Traits CalculateMoveFraction(); fromFacing = mobile.facing; toFacing = mobile.facing; - OnComplete = OnCompleteFirstHalf; + OnComplete = OnCompleteFirstHalf; + + Game.UnitInfluence.Update(mobile); } mobile.currentAction.Tick( self, mobile ); }