This is done specifically on static functions that aren't used as callbacks.
This is done to keep the code cleaner, and the I_Asserts get compiled out in Release builds.
Logic is left in the "public" functions to avoid crashes as a result of the modules.
- Player direction value uses momentum angle rather than facing angle (fixes weird nextwaypoint/position flickering while drifting)
- Raise default radius to 384
I got a "initializer element is not constant" error when compiling. From a quick Google search, it seems that const-type variables aren't totally considered constants in C. There may be a better way to fix this error.
Figure out the circuit length on map load
player->distancetofinish is now a total distance on circuit maps
some hacky alterations around circuit finish lines to correctly calculate distancetofinish
Network synchronised(?) nextwaypoint in player struct
Make the waypointheap actually a heap and not allocate memory for every individual waypoint.
No need to store id in the waypoint struct, since it can be gotten from the waypointheap now.
Includes some small refactoring of older functions - single return is a bit safer and easier to debug.
Still needs doing are: Finish Line Waypoint, Shortcut waypoints, disabled waypoints.
The actual A* method itself is a bit of a monster, but I can't figure out how to refactor it too much more.
Refactor some things to make slightly clearer code
Change comments to use completely tabs
Add extra error checks to methods for helpful debugging and safety
Use a heap of waypoints during creation to be able to search for them to make links, to not freeze the game
Add a way to clear waypoints so that the methods don't error after more than one map load
Flip the ambush flag so that adding it will make the waypoint unable to be respawned at when the feature happens
Temporarily disable K_UpdateKartPosition so that it doesn't crash on map load
Basically just copied what I planned out months ago and put it into code for now
Also changed waypointcap to be made from MT_WAYPOINTs and definitely broke position in this commit from that.