Fixed bug where units left influence behind in some circumstances.
This commit is contained in:
@@ -71,7 +71,7 @@ namespace OpenRa.Game.Traits
|
||||
public UnitMovementType GetMovementType()
|
||||
{
|
||||
var vi = self.unitInfo as UnitInfo.VehicleInfo;
|
||||
if (vi == null) return UnitMovementType.Foot;
|
||||
if (vi == null) return UnitMovementType.Foot;
|
||||
if (vi.WaterBound) return UnitMovementType.Float;
|
||||
return vi.Tracked ? UnitMovementType.Track : UnitMovementType.Wheel;
|
||||
}
|
||||
@@ -248,22 +248,22 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
var nextCell = parent.path[ parent.path.Count - 1 ];
|
||||
if( ( nextCell - mobile.toCell ) != ( mobile.toCell - mobile.fromCell ) )
|
||||
{
|
||||
if( !CanEnterCell( nextCell, self ) )
|
||||
return null;
|
||||
|
||||
parent.path.RemoveAt( parent.path.Count - 1 );
|
||||
|
||||
var ret = new MoveFirstHalf(
|
||||
BetweenCells( mobile.fromCell, mobile.toCell ),
|
||||
BetweenCells( mobile.toCell, nextCell ),
|
||||
mobile.facing,
|
||||
Util.GetNearestFacing( mobile.facing, Util.GetFacing( nextCell - mobile.toCell, mobile.facing ) ),
|
||||
moveFraction - moveFractionTotal );
|
||||
mobile.fromCell = mobile.toCell;
|
||||
mobile.toCell = nextCell;
|
||||
Game.UnitInfluence.Update( mobile );
|
||||
return ret;
|
||||
{
|
||||
if( CanEnterCell( nextCell, self ) )
|
||||
{
|
||||
parent.path.RemoveAt( parent.path.Count - 1 );
|
||||
|
||||
var ret = new MoveFirstHalf(
|
||||
BetweenCells( mobile.fromCell, mobile.toCell ),
|
||||
BetweenCells( mobile.toCell, nextCell ),
|
||||
mobile.facing,
|
||||
Util.GetNearestFacing( mobile.facing, Util.GetFacing( nextCell - mobile.toCell, mobile.facing ) ),
|
||||
moveFraction - moveFractionTotal );
|
||||
mobile.fromCell = mobile.toCell;
|
||||
mobile.toCell = nextCell;
|
||||
Game.UnitInfluence.Update( mobile );
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
var ret2 = new MoveSecondHalf(
|
||||
|
||||
Reference in New Issue
Block a user