unit/unit blocking works sensibly for first-half; a few glitches due to second-half

This commit is contained in:
Chris Forbes
2009-10-26 13:04:16 +13:00
parent aa04c869a0
commit 2058134380
2 changed files with 9 additions and 4 deletions

View File

@@ -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 );
}