Page MenuHomeWildfire Games

Unit Motion - Remove m_FinalGoal
Needs ReviewPublic

Authored by wraitii on Wed, May 15, 11:06 PM.


Group Reviewers
Restricted Owners Package(Owns No Changed Paths)

Yet another case of redundant state removal cleaning up code and letting us make things better in the future.

UnitMotion stores a target (see D1887), which isn't equivalent to a pathing goal. Several functions need to be able to compute / update a Goal from said Motion Request. Instead of doing this weirdly, we'll just recompute a goal from the motion request whenever necessary.

This makes the code more flexible since one doesn't have to be careful about whether one uses the move request data or the goal data, and it lets one update the goal more sanely. And it removes state.

This is a slightly extensive change as I merge the "goal computation" logic from MoveToTargetRange and MoveToPointRange together - needs to be reviewed.

Test Plan

Compile. Review UpdateMotionGoal. Test on the pathfinding integration test map.

Diff Detail

Event Timeline

wraitii created this revision.Wed, May 15, 11:06 PM

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

Link to build:

(this revision probably includes a few unrelated changes... I'll clean things up later)

Stan added a subscriber: Stan.Thu, May 16, 12:06 PM
Stan added inline comments.

Definition could be put out of the class, no ?


ternary ?


spaces between math operators.

wraitii updated this revision to Diff 8081.Sun, May 19, 4:58 PM
wraitii marked 3 inline comments as done.


Stan added inline comments.Sun, May 19, 5:01 PM

I guess that's a no ^^

wraitii added inline comments.Sun, May 19, 5:08 PM

could, but won't be called for anything else than UnitMotion, so better to keep it here.


meh, makes for a longer line.

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

Link to build: