From a6e7efd767aa28e9342044b7a621201ddf280517 Mon Sep 17 00:00:00 2001 From: bjarni Date: Sat, 8 Jan 2005 00:22:11 +0000 Subject: (svn r1419) fixed issue where autoreplacing dualheaded trains turned the last engine the wrong way --- vehicle.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vehicle.c b/vehicle.c index f6bb1d39e..e5565dcc0 100644 --- a/vehicle.c +++ b/vehicle.c @@ -1500,7 +1500,12 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) const RailVehicleInfo *rvi = RailVehInfo(new_engine_type); byte capacity = rvi->capacity; - v->spritenum = rvi->image_index; + if (rvi->flags & RVI_MULTIHEAD && v->next == NULL ) { + v->spritenum = rvi->image_index + 1; // +1 is the mirrored end of the dualheaded engines + } else { + v->spritenum = rvi->image_index; + } + v->cargo_type = rvi->cargo_type; v->cargo_cap = rvi->capacity; v->max_speed = rvi->max_speed; -- cgit v1.2.3-70-g09d2