# HG changeset patch # User peter1138 # Date 2006-05-31 18:00:08 # Node ID 275a737a243203b6ee73264ec064206d3d1dee69 # Parent 2c27605035ea7d86d3c599aa13802ad703a34045 (svn r5061) - NewGRF: always use visual effect callback if it is defined, not just for powered wagons. diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -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