diff options
author | peter1138 <peter1138@openttd.org> | 2007-07-05 06:35:09 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-07-05 06:35:09 +0000 |
commit | 7884a07b43fd293a2ca5b39b64df98b700959874 (patch) | |
tree | b130f112f755ad0f491a84294ff05f67066a4825 /src | |
parent | 4c356457e6335692cb5e28f279724b97e3c1c608 (diff) | |
download | openttd-7884a07b43fd293a2ca5b39b64df98b700959874.tar.xz |
(svn r10443) -Fix: randomizing triggers should be called with callback type set to 1
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_callbacks.h | 3 | ||||
-rw-r--r-- | src/newgrf_engine.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h index 05327ea88..20477bd3e 100644 --- a/src/newgrf_callbacks.h +++ b/src/newgrf_callbacks.h @@ -12,6 +12,9 @@ * Names are formatted as CBID_<CLASS>_<CALLBACK> */ enum CallbackID { + /* Set when calling a randomizing trigger (almost undocumented) */ + CBID_RANDOM_TRIGGER = 0x01, + /* Powered wagons, if the result is lower as 0x40 then the wagon is powered * @todo : interpret the rest of the result, aka "visual effects" */ CBID_TRAIN_WAGON_POWER = 0x10, diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 48d06b329..ad7dc3730 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1014,7 +1014,7 @@ static void DoTriggerVehicle(Vehicle *v, VehicleTrigger trigger, byte base_rando assert(v != NULL); NewVehicleResolver(&object, v->engine_type, v); - + object.callback = CBID_RANDOM_TRIGGER; object.trigger = trigger; group = Resolve(GetVehicleSpriteGroup(v->engine_type, v), &object); |