summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-15 14:04:48 +0000
committerhackykid <hackykid@openttd.org>2005-06-15 14:04:48 +0000
commit15b0c3b4696e6a78d003861c92f1c20fd3866842 (patch)
treead8dc8d67b116abad947f1fbce0ddec95b8e2dc8 /train_cmd.c
parentbae01fd636d99927a7281c1e24b4fff7446d0f0e (diff)
downloadopenttd-15b0c3b4696e6a78d003861c92f1c20fd3866842.tar.xz
(svn r2440) - Fix: [newgrf] Fix the spritesorter to handle overlapping sprites properly, this fixes display problems with really short wagons. (algorithm by patchman, ported by therax)
- Fix: [newgrf] Too short wagons could break the 'follow next vehicle' code used in the traincontroller. Clamp better to prevent this.
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index ded96b417..54945db93 100644
--- 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;
- veh_len = clamp(veh_len, 0, 7);
+ veh_len = 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
u->u.rail.cached_veh_length = 8 - veh_len;
};