mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Debug: Fix crash when inspecting train with realistic braking disabled
When realistic braking is otherwise enabled
This commit is contained in:
parent
994dc683a2
commit
9a131a90ca
@ -213,6 +213,7 @@ class NIHVehicle : public NIHelper {
|
|||||||
TrainDecelerationStats stats(t);
|
TrainDecelerationStats stats(t);
|
||||||
|
|
||||||
auto print_braking_speed = [&](int position, int end_speed, int end_z) {
|
auto print_braking_speed = [&](int position, int end_speed, int end_z) {
|
||||||
|
if (!t->UsingRealisticBraking()) return;
|
||||||
extern void LimitSpeedFromLookAhead(int &max_speed, const TrainDecelerationStats &stats, int current_position, int position, int end_speed, int z_delta);
|
extern void LimitSpeedFromLookAhead(int &max_speed, const TrainDecelerationStats &stats, int current_position, int position, int end_speed, int z_delta);
|
||||||
int speed = INT_MAX;
|
int speed = INT_MAX;
|
||||||
LimitSpeedFromLookAhead(speed, stats, l.current_position, position, end_speed, end_z - stats.z_pos);
|
LimitSpeedFromLookAhead(speed, stats, l.current_position, position, end_speed, end_z - stats.z_pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user