summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-24 12:47:25 +0000
committertron <tron@openttd.org>2004-11-24 12:47:25 +0000
commit0ea87b6473a11eb4d6e27275a5aa649165e79a14 (patch)
tree27c5fee6b261ded43a0af308e071411ffc8c390c
parentaceb89fb7d7aa2d8b931ffa5fd299f6893cb6867 (diff)
downloadopenttd-0ea87b6473a11eb4d6e27275a5aa649165e79a14.tar.xz
(svn r792) Small cleanup: Kill a goto
-rw-r--r--economy.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/economy.c b/economy.c
index 86b7082dc..aa1898d27 100644
--- a/economy.c
+++ b/economy.c
@@ -1221,9 +1221,8 @@ int LoadUnloadVehicle(Vehicle *v)
st = DEREF_STATION(last_visited = v->last_station_visited);
- for(;;) {
- if (v->cargo_cap == 0)
- goto next_vehicle;
+ for (; v != NULL; v = v->next) {
+ if (v->cargo_cap == 0) continue;
ge = &st->goods[v->cargo_type];
@@ -1261,8 +1260,7 @@ int LoadUnloadVehicle(Vehicle *v)
}
/* don't pick up goods that we unloaded */
- if (u->next_order & OF_UNLOAD)
- goto next_vehicle;
+ if (u->next_order & OF_UNLOAD) continue;
/* update stats */
ge->days_since_pickup = 0;
@@ -1301,10 +1299,6 @@ int LoadUnloadVehicle(Vehicle *v)
result |= 2;
st->last_vehicle = v->index;
}
-
-next_vehicle:;
- if (!(v = v->next))
- break;
}
v = u;