Changeset - r3926:275a737a2432
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-05-31 18:00:08
peter1138@openttd.org
(svn r5061) - NewGRF: always use visual effect callback if it is defined, not just for powered wagons.
1 file changed with 8 insertions and 7 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -167,14 +167,15 @@ void TrainConsistChanged(Vehicle* v)
 
		if (!IsArticulatedPart(u)) {
 
			// check if its a powered wagon
 
			CLRBIT(u->u.rail.flags, VRF_POWEREDWAGON);
 

	
 
			/* Check powered wagon / visual effect callback */
 
			if (HASBIT(rvi_u->callbackmask, CBM_WAGON_POWER)) {
 
				uint16 callback = GetVehicleCallback(CBID_TRAIN_WAGON_POWER, 0, 0, u->engine_type, u);
 

	
 
				if (callback != CALLBACK_FAILED) u->u.rail.cached_vis_effect = callback;
 
			}
 

	
 
			if ((rvi_v->pow_wag_power != 0) && (rvi_u->flags & RVI_WAGON) && UsesWagonOverride(u)) {
 
				if (HASBIT(rvi_u->callbackmask, CBM_WAGON_POWER)) {
 
					uint16 callback = GetVehicleCallback(CBID_TRAIN_WAGON_POWER, 0, 0, u->engine_type, u);
 

	
 
					if (callback != CALLBACK_FAILED)
 
						u->u.rail.cached_vis_effect = callback;
 
				}
 

	
 
				if (u->u.rail.cached_vis_effect < 0x40) {
 
					/* wagon is powered */
 
					SETBIT(u->u.rail.flags, VRF_POWEREDWAGON); // cache 'powered' status
0 comments (0 inline, 0 general)