From 01b6109751131daf2a1bfc60bd9404e358df08f5 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 3 Nov 2005 18:27:29 +0000 Subject: (svn r3126) Autoreplace: Only the first vehicle in a chain should be marked as entering a depot, so call moved out of DoVehicleTrigger loop. --- engine.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/engine.c b/engine.c index df0a16308..2ce2a21a7 100644 --- a/engine.c +++ b/engine.c @@ -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); } -- cgit v1.2.3-70-g09d2