- The `TMoverParameters::derail()` function has been renamed to `::Derail()`, with a capital D.
- All derail events now use that function.
- Simplified and unified the logic behind different derail types.
- The `dtrack_freerail` track type is now slightly increasing the chance of derailing on a tight curve, as it was the intention.
- A new `DerailReason` enum has been created which holds all derail types.
- The `DerailReason` field in the `TMoverParameters` class has been removed.
- This was a transient field which is not necessary anymore.
- The logging functionality as such has been moved from `DynObj.cpp` to `Mover.cpp`.
- The warning signal is no longer going to be played for an obnoxiously long amount of time by AI drivers when driving vehicles with a manual warning signal switch, most notably EN57.
- A new `moveDepartureWarned` driving flag has been created to accomodate this behavior.
- Added the action time counter and the missing driving flags to the Vehicle AI section.
- Fixed phase shift when the light is specified as a negative value.
- This fixes railroad crossing lights!!!
- Improved light transition times to make them even more realistic.
- Simplified the overall code.
We could have done away with it just because the memcell values are always the last parameter. However, this might not always be the case in the future. Also, it's better for consistency reasons.
- Fixed the `api.memcell_update` and `api.memcell_update_n` functions to accept the `memcell_values` structure instead of three separate values.
- Additionally, also fixed the error message for when the memcell is not found.
An undocumented change from the previous commit:
- When the Lua script is not able to find an object, the message is now printed to `errors.txt`, not just to `log.txt`.
- Lua bindings are no longer using FFI in favor of the "classic" Lua C API.
- This makes it work properly on native Linux builds.
- Changed the Lua API slightly:
- Removed the `api.event_preparefunc()` function because it is no longer necessary. Instead, you can pass any function you want without preparing it first.
- Added an `api.event_exists()` function. Takes a single `name` argument.
- Any `api.find_*()` functions return `nil` instead of an userdata representing a null pointer when the requested object is not found.