(svn r3126) Autoreplace: Only the first vehicle in a chain should be marked as entering a depot, so call moved out of DoVehicleTrigger loop.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
peter1138 19 years ago
parent 7c40462d24
commit 01b6109751

@ -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);
}

Loading…
Cancel
Save