Added int subCell = -1 to IMove.MoveIntoWorld & IPositionable.SetPosition(Actor self, CPos cell)
This commit is contained in:
@@ -182,7 +182,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
bool CanEnterCell(CPos location);
|
||||
bool CanEnterCell(CPos location, Actor ignoreActor, bool checkTransientActors);
|
||||
void SetPosition(Actor self, CPos cell);
|
||||
void SetPosition(Actor self, CPos cell, int subCell = -1);
|
||||
void SetPosition(Actor self, WPos pos);
|
||||
void SetVisualPosition(Actor self, WPos pos);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ namespace OpenRA.Traits
|
||||
Activity MoveWithinRange(Target target, WRange range);
|
||||
Activity MoveWithinRange(Target target, WRange minRange, WRange maxRange);
|
||||
Activity MoveFollow(Actor self, Target target, WRange minRange, WRange maxRange);
|
||||
Activity MoveIntoWorld(Actor self, CPos cell);
|
||||
Activity MoveIntoWorld(Actor self, CPos cell, int subCell = -1);
|
||||
Activity VisualMove(Actor self, WPos fromPos, WPos toPos);
|
||||
CPos NearestMoveableCell(CPos target);
|
||||
bool IsMoving { get; set; }
|
||||
|
||||
@@ -88,8 +88,11 @@ namespace OpenRA.Traits
|
||||
return FreeSubCell(a) >= 0;
|
||||
}
|
||||
|
||||
public int FreeSubCell(CPos a)
|
||||
public int FreeSubCell(CPos a, int preferredSubCell = -1)
|
||||
{
|
||||
if (preferredSubCell >= 0 && !AnyUnitsAt(a, preferredSubCell))
|
||||
return preferredSubCell;
|
||||
|
||||
if (!AnyUnitsAt(a))
|
||||
return map.SubCellDefaultIndex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user