diff options
author | rubidium <rubidium@openttd.org> | 2007-05-14 16:07:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-14 16:07:05 +0000 |
commit | c7d57379fbdda52590cddb83240934da6b5e8b21 (patch) | |
tree | 689c15a9e4c69b6092adb8178a4209a3fc4ed27b /src/vehicle.cpp | |
parent | d7b4fb80d0e14ca3f8d56cda920e7f0d4e81419d (diff) | |
download | openttd-c7d57379fbdda52590cddb83240934da6b5e8b21.tar.xz |
(svn r9836) -Codechange: make non-improved loading happen FIFO-ish; generally loading/unloading will happen fifo, but there are no guarantees on the FIFO-ness. For (better) FIFO guarantees you still need to use improved loading.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9048d3bd0..0b7916d29 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -659,8 +659,6 @@ static VehicleTickProc* _vehicle_tick_procs[] = { void CallVehicleTicks() { - Vehicle *v; - #ifdef ENABLE_NETWORK /* hotfix for desync problem: * for MP games invalidate the YAPF cache every tick to keep it exactly the same on the server and all clients */ @@ -671,6 +669,10 @@ void CallVehicleTicks() _first_veh_in_depot_list = NULL; // now we are sure it's initialized at the start of each tick + Station *st; + FOR_ALL_STATIONS(st) LoadUnloadStation(st); + + Vehicle *v; FOR_ALL_VEHICLES(v) { _vehicle_tick_procs[v->type](v); @@ -2933,17 +2935,8 @@ void Vehicle::HandleLoading(bool mode) { switch (this->current_order.type) { case OT_LOADING: { - /* Not the first call for this tick */ - if (mode) return; - - /* We have not waited enough time till the next round of loading/unloading */ - if (--this->load_unload_time_rem) return; - - /* Load/unload the vehicle; when it actually did something - * we do not leave the station. */ - LoadUnloadVehicle(this); - - if (!HASBIT(this->vehicle_flags, VF_LOADING_FINISHED)) return; + /* Not the first call for this tick, or still loading */ + if (mode || !HASBIT(this->vehicle_flags, VF_LOADING_FINISHED)) return; this->PlayLeaveStationSound(); |