mirror of https://github.com/OpenTTD/OpenTTD
(svn r792) Small cleanup: Kill a goto
parent
aceb89fb7d
commit
0ea87b6473
12
economy.c
12
economy.c
|
@ -1221,9 +1221,8 @@ int LoadUnloadVehicle(Vehicle *v)
|
||||||
|
|
||||||
st = DEREF_STATION(last_visited = v->last_station_visited);
|
st = DEREF_STATION(last_visited = v->last_station_visited);
|
||||||
|
|
||||||
for(;;) {
|
for (; v != NULL; v = v->next) {
|
||||||
if (v->cargo_cap == 0)
|
if (v->cargo_cap == 0) continue;
|
||||||
goto next_vehicle;
|
|
||||||
|
|
||||||
ge = &st->goods[v->cargo_type];
|
ge = &st->goods[v->cargo_type];
|
||||||
|
|
||||||
|
@ -1261,8 +1260,7 @@ int LoadUnloadVehicle(Vehicle *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* don't pick up goods that we unloaded */
|
/* don't pick up goods that we unloaded */
|
||||||
if (u->next_order & OF_UNLOAD)
|
if (u->next_order & OF_UNLOAD) continue;
|
||||||
goto next_vehicle;
|
|
||||||
|
|
||||||
/* update stats */
|
/* update stats */
|
||||||
ge->days_since_pickup = 0;
|
ge->days_since_pickup = 0;
|
||||||
|
@ -1301,10 +1299,6 @@ int LoadUnloadVehicle(Vehicle *v)
|
||||||
result |= 2;
|
result |= 2;
|
||||||
st->last_vehicle = v->index;
|
st->last_vehicle = v->index;
|
||||||
}
|
}
|
||||||
|
|
||||||
next_vehicle:;
|
|
||||||
if (!(v = v->next))
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
v = u;
|
v = u;
|
||||||
|
|
Loading…
Reference in New Issue