- 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.
- 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.
Add engine temperature monitoring to diesel locomotive heat management system:
- Add engine field to heat_data struct (fluid_circuit_t type)
- Add EngineMaxTemperature config extraction in .fiz files
- Add engine overheat detection logic (is_hot check)
- Include engine.is_hot in PT status check
Implements issue #77: Oil, water and engine overheat lamps for diesel locomotives
- Add engine_max_temp and engine_is_hot fields to heat_data structure
- Add EngineMaxTemperature field extraction from .fiz files
- Add engine overheat check comparing Ts with engine_max_temp
- Add four new overheat lamp indicators:
- i-oil_overheat
- i-water_overheat
- i-wateraux_overheat
- i-engine_overheat
- Add lamp update logic to turn on/off based on is_hot flags
- Add lamp initialization in clear_cab_controls()
This implements issue #77 - overheat lamps for diesel engines.
The lamps will turn on when:
- Oil temperature exceeds OilMaxTemperature
- Water temperature exceeds WaterMaxTemperature
- Auxiliary water temperature exceeds WaterAuxMaxTemperature
- Engine temperature exceeds EngineMaxTemperature
Each check includes 8-degree hysteresis to prevent rapid on/off cycling.
- 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.