Changeset - r1909:f13697536803
[Not reviewed]
master
0 2 0
hackykid - 19 years ago 2005-06-06 01:31:36
hackykid@openttd.org
(svn r2415) - Fix: [newgrf] Powered Wagons - Don't assume an undefined callback will fail.
2 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
engine.h
Show inline comments
 
@@ -144,6 +144,7 @@ enum CallbackID {
 
// bit positions for rvi->callbackmask, indicates which callbacks are used by an engine
 
// (some callbacks are always used, and dont appear here)
 
enum CallbackMask {
 
	CBM_WAGON_POWER = 0,
 
	CBM_REFIT_CAP = 3,
 
};
 

	
train_cmd.c
Show inline comments
 
@@ -79,9 +79,10 @@ void TrainConsistChanged(Vehicle *v) {
 
		// check if its a powered wagon
 
		CLRBIT(u->u.rail.flags, VRF_POWEREDWAGON);
 
		if ((rvi_v->pow_wag_power != 0) && (rvi_u->flags & RVI_WAGON) && UsesWagonOverride(u)) {
 
			uint16 callback;
 

	
 
			callback = GetCallBackResult(CBID_WAGON_POWER,  u->engine_type, u);
 
			uint16 callback = CALLBACK_FAILED;
 

	
 
			if (HASBIT(rvi_u->callbackmask, CBM_WAGON_POWER))
 
				callback = GetCallBackResult(CBID_WAGON_POWER,  u->engine_type, u);
 

	
 
			if (callback == CALLBACK_FAILED)
 
				callback = rvi_u->visual_effect;
0 comments (0 inline, 0 general)