(svn r16680) -Codechange: don't go through all the station unloading stuff when there is no vehicle at the station

This commit is contained in:
rubidium 2009-06-28 14:29:58 +00:00
parent 1e09854cb7
commit eb4380f5ea
1 changed files with 3 additions and 0 deletions

View File

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