From 3610c0474b5e9c56ea1925748afa034296f8e966 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 6 Nov 2005 10:17:20 +0000 Subject: [PATCH] (svn r3145) Fix two off-by-one errors in building articulated rail vehicles. --- train_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train_cmd.c b/train_cmd.c index d39535bfd0..bf4141ca22 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -439,7 +439,7 @@ static uint CountArticulatedParts(const RailVehicleInfo *rvi, EngineID engine_ty break; } - return i; + return i - 1; } static void AddArticulatedParts(const RailVehicleInfo *rvi, Vehicle **vl) @@ -463,7 +463,7 @@ static void AddArticulatedParts(const RailVehicleInfo *rvi, Vehicle **vl) u->next = vl[i]; u = u->next; - engine_type = GB(callback, 0, 6); + engine_type = GB(callback, 0, 7); flip_image = HASBIT(callback, 7); rvi_artic = RailVehInfo(engine_type);