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;
|
continue;
|
||||||
if (Game.BuildingInfluence.GetBuildingAt(newHere - offset) != null)
|
if (Game.BuildingInfluence.GetBuildingAt(newHere - offset) != null)
|
||||||
continue;
|
continue;
|
||||||
if (Game.UnitInfluence.GetUnitAt(newHere - offset) != null)
|
//if (Game.UnitInfluence.GetUnitAt(newHere - offset) != null)
|
||||||
continue;
|
// continue;
|
||||||
|
|
||||||
double cellCost = ( ( d.X * d.Y != 0 ) ? 1.414213563 : 1.0 ) * passableCost[(int)umt][ newHere.X, newHere.Y ];
|
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;
|
double newCost = cellInfo[ here.X, here.Y ].MinCost + cellCost;
|
||||||
|
|||||||
@@ -160,7 +160,10 @@ namespace OpenRa.Game.Traits
|
|||||||
if( firstFacing != mobile.facing )
|
if( firstFacing != mobile.facing )
|
||||||
mobile.currentAction = new Turn( firstFacing ) { NextAction = this };
|
mobile.currentAction = new Turn( firstFacing ) { NextAction = this };
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var unitAtDest = Game.UnitInfluence.GetUnitAt(nextCell);
|
||||||
|
if ( unitAtDest != null && unitAtDest != self )
|
||||||
|
return; /* todo: repath, sometimes */
|
||||||
mobile.toCell = nextCell;
|
mobile.toCell = nextCell;
|
||||||
path.RemoveAt( path.Count - 1 );
|
path.RemoveAt( path.Count - 1 );
|
||||||
moveFractionTotal = ( dir.X != 0 && dir.Y != 0 ) ? 35 : 25;
|
moveFractionTotal = ( dir.X != 0 && dir.Y != 0 ) ? 35 : 25;
|
||||||
@@ -169,7 +172,9 @@ namespace OpenRa.Game.Traits
|
|||||||
CalculateMoveFraction();
|
CalculateMoveFraction();
|
||||||
fromFacing = mobile.facing;
|
fromFacing = mobile.facing;
|
||||||
toFacing = mobile.facing;
|
toFacing = mobile.facing;
|
||||||
OnComplete = OnCompleteFirstHalf;
|
OnComplete = OnCompleteFirstHalf;
|
||||||
|
|
||||||
|
Game.UnitInfluence.Update(mobile);
|
||||||
}
|
}
|
||||||
mobile.currentAction.Tick( self, mobile );
|
mobile.currentAction.Tick( self, mobile );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user