Set BackwardDuration to -1 means ignore the time and set MaxBackwardCells to -1 means ignore the distance.

This commit is contained in:
dnqbob
2023-07-29 20:53:04 +08:00
committed by Gustas
parent d7ef22d64f
commit a3c5945f2a
2 changed files with 8 additions and 3 deletions

View File

@@ -160,7 +160,10 @@ namespace OpenRA.Mods.Common.Activities
var firstFacing = self.World.Map.FacingBetween(mobile.FromCell, nextCell.Value.Cell, mobile.Facing);
if (mobile.Info.CanMoveBackward && path.Count < mobile.Info.MaxBackwardCells && self.World.WorldTick - startTicks < mobile.Info.BackwardDuration && Math.Abs(firstFacing.Angle - mobile.Facing.Angle) > 256)
if (mobile.Info.CanMoveBackward
&& (mobile.Info.MaxBackwardCells < 0 || path.Count < mobile.Info.MaxBackwardCells)
&& (mobile.Info.BackwardDuration < 0 || self.World.WorldTick - startTicks < mobile.Info.BackwardDuration)
&& Math.Abs(firstFacing.Angle - mobile.Facing.Angle) > 256)
{
ActorFacingModifier = new WAngle(512);
firstFacing += ActorFacingModifier;