mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 12:24:15 +00:00
(svn r15793) -Feature: Allow train vehicles to be shorten to 1/8 length, even if not at the end of the train.
This commit is contained in:
parent
88a95661a3
commit
ce513b46b7
@ -324,7 +324,7 @@ void TrainConsistChanged(Vehicle *v, bool same_length)
|
||||
veh_len = GetVehicleCallback(CBID_VEHICLE_LENGTH, 0, 0, u->engine_type, u);
|
||||
}
|
||||
if (veh_len == CALLBACK_FAILED) veh_len = rvi_u->shorten_factor;
|
||||
veh_len = 8 - Clamp(veh_len, 0, u->Next() == NULL ? 7 : 5); // the clamp on vehicles not the last in chain is stricter, as too short wagons can break the 'follow next vehicle' code
|
||||
veh_len = 8 - Clamp(veh_len, 0, 7);
|
||||
|
||||
/* verify length hasn't changed */
|
||||
if (same_length && veh_len != u->u.rail.cached_veh_length) RailVehicleLengthChanged(u);
|
||||
|
Loading…
Reference in New Issue
Block a user