mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r2431) - Fix: [newgrf] clamp() instead of assert() on the result of the vehicle length calculation, as it can depend on external input. (thanks tron)
This commit is contained in:
parent
8a0f4f32ea
commit
d0cdb45b6c
@ -119,7 +119,7 @@ void TrainConsistChanged(Vehicle *v) {
|
||||
veh_len = GetCallBackResult(CBID_VEH_LENGTH, u->engine_type, u);
|
||||
if (veh_len == CALLBACK_FAILED)
|
||||
veh_len = rvi_u->shorten_factor;
|
||||
assert(veh_len < 8);
|
||||
veh_len = clamp(veh_len, 0, 7);
|
||||
u->u.rail.cached_veh_length = 8 - veh_len;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user