HomeWildfire Games

Drop an indentation level in UnitMotion.


Drop an indentation level in UnitMotion.

This will simplify later changes.

Differential Revision: https://code.wildfiregames.com/D1893

Event Timeline

elexis added a subscriber: elexis.Jun 25 2019, 8:24 PM
elexis added inline comments.

There is a small logic change in so far as that the default: case is now doing what is done below, whereas before that code below was only called for PATHSTATE_FOLLOWING*. I suppose this is equivalent since the default case might never occur unless the m_PathState is somehow broken before. Actually if the default case can never occur, then one can drop yet another indentation level?

One could also go a step further and split this into two separate functions.
And it can be achieved without losing the switch, for example a switch that calls functions per enum value.

(No requested changes or concern in this post)