# HG changeset patch # User hackykid # Date 2005-06-07 16:44:54 # Node ID db76bbf7e2c72f0aa67ab66784cdc928949bc980 # Parent 38ce4fc5847c42953e60e6b47f759de45ae481b5 (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) diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -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; };