Added attack order. Cursor is currently incorrect.
This commit is contained in:
@@ -47,9 +47,12 @@ namespace OpenRa.Game.Traits
|
||||
fromCell = toCell;
|
||||
}
|
||||
|
||||
public Order Order(Actor self, int2 xy, bool lmb)
|
||||
public Order Order(Actor self, int2 xy, bool lmb, Actor underCursor)
|
||||
{
|
||||
if( lmb ) return null;
|
||||
if( lmb ) return null;
|
||||
|
||||
if( underCursor != null )
|
||||
return null;
|
||||
|
||||
if (xy != toCell)
|
||||
return new MoveOrder(self, xy);
|
||||
@@ -248,21 +251,21 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
var nextCell = parent.path[ parent.path.Count - 1 ];
|
||||
if( ( nextCell - mobile.toCell ) != ( mobile.toCell - mobile.fromCell ) )
|
||||
{
|
||||
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;
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user