Changeset - r2608:962f4c747f96
[Not reviewed]
master
0 1 0
peter1138 - 19 years ago 2005-11-06 10:17:20
peter1138@openttd.org
(svn r3145) Fix two off-by-one errors in building articulated rail vehicles.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -436,13 +436,13 @@ static uint CountArticulatedParts(const 
 
	for (i = 1; i < 10; i++) {
 
		callback = GetCallBackResult(CBID_ARTIC_ENGINE + (i << 8), engine_type, NULL);
 
		if (callback == CALLBACK_FAILED || callback == 0xFF)
 
			break;
 
	}
 

	
 
	return i;
 
	return i - 1;
 
}
 

	
 
static void AddArticulatedParts(const RailVehicleInfo *rvi, Vehicle **vl)
 
{
 
	const RailVehicleInfo *rvi_artic;
 
	EngineID engine_type;
 
@@ -460,13 +460,13 @@ static void AddArticulatedParts(const Ra
 
		if (callback == CALLBACK_FAILED || callback == 0xFF)
 
			return;
 

	
 
		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);
 

	
 
		// get common values from first engine
 
		u->direction = v->direction;
 
		u->owner = v->owner;
0 comments (0 inline, 0 general)