In the heuristic search, tiles in wide path were always being handled as junctions. Changed to handle junctions according to the path thinning.
There was no search loop detection. Added loop detection for returning to the starting location and any of the junctions visited in the current search path.
Various other optimisations added.
Recent commits have caused the sprite spatial index to be uninitialised for the editor modes. Call
eset_sprite_spatial_index within
eset_sprite_list as the two come hand in hand.
This creates a checksum (SHA1) every so often on server and sends this
value together with PRNG seed for client to check it has still not
desynced.
It's useful to detect a desync early on, as PRNG seeds may remain
unchanged for some more time, while damage may have already been caused.
Some fields were left uninitialised explicitly (like rct_peep::var_73) but
used when doing logic. If they contained garbage from before the new
sprites were created, it could eventually lead to a desync later on.
This commit adds a new function: `sprite_reset`, which zeroes memory for
a new sprite and is called whenever a sprite is created. Some fields
have to be retained for the sprite to link properly in linked lists,
this function takes care of it.
Due to a mistake from 2014 the number of map elements that could be used in a park was mistakenly assumed to be the same size as the s6 data for map elements. It turns out there are 256*256 spare elements for whatever reason. When the map element reorginisation code was refactored to remove magic numbers this incorrect value was used instead. This would cause the map element inserter to allocate a map element that shared the same mememory as a sprite. This would cause issues when the sprite tried to update or the map element tried to draw.
Refactor and improve the object system:
- Objects are now exported to user directory under 'object'.
- Object directories are scanned recursively.
- Improves reliability of object loading and handling of bad objects.
- Improve performance of object scanning.
- Only load new objects when loading a new game.
- Improve changing language experience.
Shift correctly direction bits when calling game_do_command.
game_command_remove_large_scenery() expects the direction bits
to be shifted 8 times to the left, so the call to game_do_command
has been modified to match this requirement.