summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-28 14:29:58 +0000
committerrubidium <rubidium@openttd.org>2009-06-28 14:29:58 +0000
commiteb4380f5eae0c3a743bc9c968c639069d46d791e (patch)
treede343439a39c5ebe5627e987d00ee595173979f0
parent1e09854cb7484a0317de81d412c6a541a96dacb6 (diff)
downloadopenttd-eb4380f5eae0c3a743bc9c968c639069d46d791e.tar.xz
(svn r16680) -Codechange: don't go through all the station unloading stuff when there is no vehicle at the station
-rw-r--r--src/economy.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 5cc2788b6..46b8ac90b 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1519,6 +1519,9 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
*/
void LoadUnloadStation(Station *st)
{
+ /* No vehicle is here... */
+ if (st->loading_vehicles.empty()) return;
+
int cargo_left[NUM_CARGO];
for (uint i = 0; i < NUM_CARGO; i++) cargo_left[i] = st->goods[i].cargo.Count();