From b0e8d229ee1a0e138302164a38a88b9a3bb13d27 Mon Sep 17 00:00:00 2001 From: glx Date: Fri, 29 Jun 2007 00:26:10 +0000 Subject: [PATCH] (svn r10383) [0.5] -Fix (r10373, FS#958): v->z_pos was wrong for trains on bridge --- train_cmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/train_cmd.c b/train_cmd.c index 5d18b49af4..c615c48ffb 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -2749,7 +2749,11 @@ static void TrainEnterStation(Vehicle *v, StationID station) static byte AfterSetTrainPos(Vehicle *v, bool new_tile) { byte old_z = v->z_pos; + + /* need this hint so it returns the right z coordinate on bridges. */ + _get_z_hint = old_z; v->z_pos = GetSlopeZ(v->x_pos, v->y_pos); + _get_z_hint = 0; if (new_tile) { CLRBIT(v->u.rail.flags, VRF_GOINGUP);