diff options
author | peter1138 <peter1138@openttd.org> | 2005-11-03 18:27:29 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2005-11-03 18:27:29 +0000 |
commit | 01b6109751131daf2a1bfc60bd9404e358df08f5 (patch) | |
tree | 0498e473ee09363900663354e5f4ec4b0dd00d14 | |
parent | 7c40462d24e78fb050c78fa17ca578023160c186 (diff) | |
download | openttd-01b6109751131daf2a1bfc60bd9404e358df08f5.tar.xz |
(svn r3126) Autoreplace: Only the first vehicle in a chain should be marked as entering a depot, so call moved out of DoVehicleTrigger loop.
-rw-r--r-- | engine.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -718,12 +718,6 @@ static void DoTriggerVehicle(Vehicle *veh, VehicleTrigger trigger, byte base_ran (resolve_callback) TriggerVehicleSpriteGroup); } - if (trigger == VEHICLE_TRIGGER_DEPOT) { - // store that the vehicle entered a depot this tick - // it needs to be before all possible return statements; - VehicleEnteredDepotThisTick(veh); - } - if (group == NULL) return; @@ -773,6 +767,11 @@ static void DoTriggerVehicle(Vehicle *veh, VehicleTrigger trigger, byte base_ran void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger) { + if (trigger == VEHICLE_TRIGGER_DEPOT) { + // store that the vehicle entered a depot this tick + VehicleEnteredDepotThisTick(veh); + } + DoTriggerVehicle(veh, trigger, 0, true); } |