Introduce IdleMovementSpeed

That actually factors in speed modifiers and trait pause/disable.
This commit is contained in:
reaperrr
2021-06-18 18:33:47 +02:00
committed by Paul Chote
parent 1262a9c6c9
commit 5a548d6acc
2 changed files with 3 additions and 3 deletions

View File

@@ -52,10 +52,8 @@ namespace OpenRA.Mods.Common.Activities
if (isIdleTurner)
{
var speed = aircraft.Info.IdleSpeed < 0 ? aircraft.Info.Speed : aircraft.Info.IdleSpeed;
// This override is necessary, otherwise aircraft with CanSlide would circle sideways
var move = aircraft.FlyStep(speed, aircraft.Facing);
var move = aircraft.FlyStep(aircraft.IdleMovementSpeed, aircraft.Facing);
// We can't possibly turn this fast
var desiredFacing = aircraft.Facing + new WAngle(256);

View File

@@ -607,6 +607,8 @@ namespace OpenRA.Mods.Common.Traits
}
public int MovementSpeed => !IsTraitDisabled && !IsTraitPaused ? Util.ApplyPercentageModifiers(Info.Speed, speedModifiers) : 0;
public int IdleMovementSpeed => Info.IdleSpeed < 0 ? MovementSpeed :
!IsTraitDisabled && !IsTraitPaused ? Util.ApplyPercentageModifiers(Info.IdleSpeed, speedModifiers) : 0;
public (CPos Cell, SubCell SubCell)[] OccupiedCells()
{