diff options
author | peter1138 <peter1138@openttd.org> | 2006-05-31 18:00:08 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-05-31 18:00:08 +0000 |
commit | 17d774517b086c8e373c600bb14b2d3ab701ebbc (patch) | |
tree | 82914d37ab472f9a830930fcc1dc96af3616159c | |
parent | 40008b82703cfe72c490b508f231a5deea7abfb7 (diff) | |
download | openttd-17d774517b086c8e373c600bb14b2d3ab701ebbc.tar.xz |
(svn r5061) - NewGRF: always use visual effect callback if it is defined, not just for powered wagons.
-rw-r--r-- | train_cmd.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/train_cmd.c b/train_cmd.c index 270b3c233..13f87f874 100644 --- 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); - 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; - } + /* 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 (u->u.rail.cached_vis_effect < 0x40) { /* wagon is powered */ SETBIT(u->u.rail.flags, VRF_POWEREDWAGON); // cache 'powered' status |