unit/unit blocking works sensibly for first-half; a few glitches due to second-half
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -161,6 +161,9 @@ namespace OpenRa.Game.Traits
|
||||
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;
|
||||
@@ -170,6 +173,8 @@ namespace OpenRa.Game.Traits
|
||||
fromFacing = mobile.facing;
|
||||
toFacing = mobile.facing;
|
||||
OnComplete = OnCompleteFirstHalf;
|
||||
|
||||
Game.UnitInfluence.Update(mobile);
|
||||
}
|
||||
mobile.currentAction.Tick( self, mobile );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user