Add AlwaysTurnInPlace option to Mobile.

This commit is contained in:
tovl
2020-06-16 19:22:53 +02:00
committed by abcdefg30
parent 1c8c49dc8e
commit b79aa7eb6a
2 changed files with 7 additions and 0 deletions

View File

@@ -496,6 +496,10 @@ namespace OpenRA.Mods.Common.Activities
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.
var nextFacing = map.FacingBetween(nextCell, mobile.ToCell, mobile.Facing);
var currentFacing = map.FacingBetween(mobile.ToCell, mobile.FromCell, mobile.Facing);