Page MenuHomeWildfire Games

Unit Motion - wrap target state into a struct
Needs ReviewPublic

Authored by wraitii on Mon, May 13, 9:46 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

These variables together held the state for the target of UnitMotion, as set by the MoveTo[X] family of functions.
Wrapping them in a struct reduces the chances that one will accidentally forget to reset part of the state and makes it explicit in-code that these are grouped together.

We also reset these when calling StopMoving(), which was missed before (and which left us in a half-broken state). D1886 makes this fine since unitMotion is no longer stopping on its own.

Test Plan

Compile.

Diff Detail

Event Timeline

wraitii created this revision.Mon, May 13, 9:46 PM

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

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

Stan added a subscriber: Stan.Thu, May 16, 12:08 PM
Stan added inline comments.
source/simulation2/components/CCmpUnitMotion.cpp
230–258
wraitii updated this revision to Diff 8071.Sun, May 19, 4:44 PM

Updated (maybe, I've lost track of what I've changed)

wraitii added inline comments.Sun, May 19, 5:09 PM
source/simulation2/components/CCmpUnitMotion.cpp
230–258

It's POD-like and doesn't really do anything too clever. The serialisation could/should be moved to the component, and the GetOffset is just readability sugar.

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

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

wraitii updated this revision to Diff 8122.Sat, May 25, 4:30 PM

Rebased

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

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