(svn r1419) fixed issue where autoreplacing dualheaded trains turned the last engine the wrong way
authorbjarni
Sat, 08 Jan 2005 00:22:11 +0000
changeset 931 524393b0c842
parent 930 524b02923ede
child 932 5fcff6cdc612
(svn r1419) fixed issue where autoreplacing dualheaded trains turned the last engine the wrong way
vehicle.c
--- a/vehicle.c	Fri Jan 07 23:59:59 2005 +0000
+++ b/vehicle.c	Sat Jan 08 00:22:11 2005 +0000
@@ -1500,7 +1500,12 @@
 				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;