From eb4380f5eae0c3a743bc9c968c639069d46d791e Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 28 Jun 2009 14:29:58 +0000 Subject: [PATCH] (svn r16680) -Codechange: don't go through all the station unloading stuff when there is no vehicle at the station --- src/economy.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/economy.cpp b/src/economy.cpp index 5cc2788b64..46b8ac90b2 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();