Page MenuHomeWildfire Games

UnitMotion - move "possibly at destination" checks earlier in Move()
ClosedPublic

Authored by wraitii on May 15 2019, 10:49 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22365: Fix 'gliding' behaviour at the end of movement by moving the…
Summary

Units in 0 A.D. currently exhibit a "gliding" behaviour at the end of a movement: they switch to the Idle animation and still move a little bit.

This is because of poor handling of state and one risky behaviour: checking if we are at destination after movement has taken place. Effectively, UnitMotion says it's arrived on the same turn as it moved, which breaks expectations in other components.
Instead, what should be done is checking if we've arrived before moving, so if UnitAI calls StopMoving, we won't move at all on the same turn, and the gliding effect vanishes.

The STATE_STOPPING state is made un-necessary by this change, since this off-by-one mistake was the reason for its existence. It can be removed (see downstream).

Because of D1897, this is a simple change.

Test Plan

Compile, acknowledge that the gliding behaviour is fixed.

Diff Detail

Event Timeline

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/differential/1416/display/redirect

wraitii updated this revision to Diff 8077.May 19 2019, 4:51 PM

Updated

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/differential/1453/display/redirect

wraitii updated this revision to Diff 8431.Jun 11 2019, 7:30 PM

Rebased for committing

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/1690/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Jun 11 2019, 8:52 PM
This revision was automatically updated to reflect the committed changes.