Add AlwaysTurnInPlace option to Mobile.
This commit is contained in:
@@ -496,6 +496,10 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
|
|
||||||
static bool IsTurn(Mobile mobile, CPos nextCell, Map map)
|
static bool IsTurn(Mobile mobile, CPos nextCell, Map map)
|
||||||
{
|
{
|
||||||
|
// Some actors with a limited number of sprite facings should never move along curved trajectories.
|
||||||
|
if (mobile.Info.AlwaysTurnInPlace)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Tight U-turns should be done in place instead of making silly looking loops.
|
// Tight U-turns should be done in place instead of making silly looking loops.
|
||||||
var nextFacing = map.FacingBetween(nextCell, mobile.ToCell, mobile.Facing);
|
var nextFacing = map.FacingBetween(nextCell, mobile.ToCell, mobile.Facing);
|
||||||
var currentFacing = map.FacingBetween(mobile.ToCell, mobile.FromCell, mobile.Facing);
|
var currentFacing = map.FacingBetween(mobile.ToCell, mobile.FromCell, mobile.Facing);
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public readonly int Speed = 1;
|
public readonly int Speed = 1;
|
||||||
|
|
||||||
|
[Desc("If set to true, this unit will always turn in place instead of following a curved trajectory (like infantry).")]
|
||||||
|
public readonly bool AlwaysTurnInPlace = false;
|
||||||
|
|
||||||
[Desc("Cursor to display when a move order can be issued at target location.")]
|
[Desc("Cursor to display when a move order can be issued at target location.")]
|
||||||
public readonly string Cursor = "move";
|
public readonly string Cursor = "move";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user