Set Mobile.IsMoving to "true" if queueing a turn that takes only a single tick
At the end of L-turns, actors often end up with an internal facing not 100% matching the direction of the next cell on their path. As a result, if they haven't reached their destination yet, Move queues a quick Turn as ChildActivity, which previously was not considered as IsMoving. However, we don't want those mini-turns to interrupt move animations, so we now consider them a move as well. Additionally, to avoid any issues, we make these mini-turns non-interruptible, just like the MovePart activities already are.
This commit is contained in:
@@ -224,7 +224,14 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (firstFacing != mobile.Facing)
|
||||
{
|
||||
path.Add(nextCell.Value.First);
|
||||
QueueChild(new Turn(self, firstFacing));
|
||||
|
||||
// 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.
|
||||
// To avoid issues, we also make these mini-turns uninterruptible (like MovePart activities) to ensure the actor
|
||||
// finishes that mini-turn before starting something else.
|
||||
var facingWithinTolerance = Util.FacingWithinTolerance(mobile.Facing, firstFacing, mobile.TurnSpeed);
|
||||
QueueChild(new Turn(self, firstFacing, facingWithinTolerance, !facingWithinTolerance));
|
||||
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user