summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-11-03 18:27:29 +0000
committerpeter1138 <peter1138@openttd.org>2005-11-03 18:27:29 +0000
commit4f5dee9e586a490516a93ba354788624e7b346fd (patch)
tree0498e473ee09363900663354e5f4ec4b0dd00d14
parent47f0e22853bc9c3ee332bafcf8d223a170a064f7 (diff)
downloadopenttd-4f5dee9e586a490516a93ba354788624e7b346fd.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.c11
1 files 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);
}