Add AlwaysConsiderTurnAsMove plumbing to Mobile

Can be used to make walker units like the TS mechs display move animations while turning on the spot.
This commit is contained in:
reaperrr
2018-06-10 00:39:48 +02:00
committed by reaperrr
parent 755cc40459
commit 6984c0ec10
2 changed files with 8 additions and 0 deletions

View File

@@ -225,6 +225,11 @@ namespace OpenRA.Mods.Common.Activities
{
path.Add(nextCell.Value.First);
// If Mobile.Info.AlwaysConsiderTurnAsMove is true, we consider Turn as movement regardless of facing delta size.
// IsMoving is then set back to false in Turn.OnLastRun.
// This is needed for actors that want to display their movement animation during turns (walker units, for example).
mobile.IsMoving = mobile.Info.AlwaysConsiderTurnAsMove;
// HACK: To fix visual hiccups on actors with move animations during "L-turn to next part of movement" transitions
// or invisible mini-turns (due to less sprite facings than internal facings), we set IsMoving to 'true' during Turn activity
// when the facing delta is low enough to be covered with a single Turn tick.