Fix train braking behaviour when lookahead is aspect limited
When lookahead end is within the reservation end
This commit is contained in:
@@ -289,7 +289,8 @@ class NIHVehicle : public NIHelper {
|
|||||||
if (HasBit(item.data_aux, TRSLAI_NEXT_ONLY)) b += seprintf(b, lastof(buffer), "s");
|
if (HasBit(item.data_aux, TRSLAI_NEXT_ONLY)) b += seprintf(b, lastof(buffer), "s");
|
||||||
if (HasBit(item.data_aux, TRSLAI_COMBINED)) b += seprintf(b, lastof(buffer), "c");
|
if (HasBit(item.data_aux, TRSLAI_COMBINED)) b += seprintf(b, lastof(buffer), "c");
|
||||||
if (HasBit(item.data_aux, TRSLAI_COMBINED_SHUNT)) b += seprintf(b, lastof(buffer), "X");
|
if (HasBit(item.data_aux, TRSLAI_COMBINED_SHUNT)) b += seprintf(b, lastof(buffer), "X");
|
||||||
if (_settings_game.vehicle.realistic_braking_aspect_limited == TRBALM_ON && l.lookahead_end_position == item.start) {
|
if (_settings_game.vehicle.realistic_braking_aspect_limited == TRBALM_ON &&
|
||||||
|
(l.lookahead_end_position == item.start || l.lookahead_end_position == item.start + 1)) {
|
||||||
b += seprintf(b, lastof(buffer), ", lookahead end");
|
b += seprintf(b, lastof(buffer), ", lookahead end");
|
||||||
print_braking_speed(item.start, 0, item.z_pos);
|
print_braking_speed(item.start, 0, item.z_pos);
|
||||||
}
|
}
|
||||||
|
@@ -959,7 +959,8 @@ static void ApplyLookAheadItem(const Train *v, const TrainReservationLookAheadIt
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TRLIT_SIGNAL:
|
case TRLIT_SIGNAL:
|
||||||
if (_settings_game.vehicle.realistic_braking_aspect_limited == TRBALM_ON && v->lookahead->lookahead_end_position == item.start) {
|
if (_settings_game.vehicle.realistic_braking_aspect_limited == TRBALM_ON &&
|
||||||
|
(v->lookahead->lookahead_end_position == item.start || v->lookahead->lookahead_end_position == item.start + 1)) {
|
||||||
limit_advisory_speed(item.start, 0, item.z_pos);
|
limit_advisory_speed(item.start, 0, item.z_pos);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user