Changeset - r2441:9b5bc4db6b36
[Not reviewed]
master
0 1 0
peter1138 - 19 years ago 2005-09-20 19:35:52
peter1138@openttd.org
(svn r2967) Fix: newgrf: Wagon speed limits don't apply for wagons with livery overrides. Fixes max speed in dbsetxl etc.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -104,25 +104,25 @@ void TrainConsistChanged(Vehicle *v) {
 

	
 
			if (callback == CALLBACK_FAILED)
 
				callback = rvi_u->visual_effect;
 

	
 
			if (callback < 0x40) {
 
				/* wagon is powered */
 
				SETBIT(u->u.rail.flags, VRF_POWEREDWAGON); // cache 'powered' status
 
				power += rvi_v->pow_wag_power;
 
			}
 
		}
 

	
 
		// max speed is the minimum of the speed limits of all vehicles in the consist
 
		if (rvi_u->max_speed != 0)
 
		if (rvi_u->max_speed != 0 && !UsesWagonOverride(u))
 
			max_speed = min(rvi_u->max_speed, max_speed);
 

	
 
		// check the vehicle length (callback)
 
		veh_len = CALLBACK_FAILED;
 
		if (HASBIT(rvi_u->callbackmask, CBM_VEH_LENGTH))
 
			veh_len = GetCallBackResult(CBID_VEH_LENGTH,  u->engine_type, u);
 
		if (veh_len == CALLBACK_FAILED)
 
			veh_len = rvi_u->shorten_factor;
 
		veh_len = clamp(veh_len, 0, u->next == NULL ? 7 : 5); // the clamp on vehicles not the last in chain is stricter, as too short wagons can break the 'follow next vehicle' code
 
		u->u.rail.cached_veh_length = 8 - veh_len;
 

	
 
	};
0 comments (0 inline, 0 general)