summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-26 22:45:48 +0000
committersmatz <smatz@openttd.org>2009-05-26 22:45:48 +0000
commit5a463c8347fe1e68ab31dda1425e9060d52bfbd6 (patch)
tree55f5c9de8dcbda6268d003b29af59650594ce27a /src/station_cmd.cpp
parent7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c (diff)
downloadopenttd-5a463c8347fe1e68ab31dda1425e9060d52bfbd6.tar.xz
(svn r16442) -Codechange: use new Vehicle accessors at more places
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 85fdde83f..296353f75 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1547,11 +1547,9 @@ static CommandCost RemoveRoadStop(Station *st, DoCommandFlag flags, TileIndex ti
delete cur_stop;
/* Make sure no vehicle is going to the old roadstop */
- Vehicle *v;
- FOR_ALL_VEHICLES(v) {
- if (v->type == VEH_ROAD &&
- v->First() == v &&
- v->current_order.IsType(OT_GOTO_STATION) &&
+ RoadVehicle *v;
+ FOR_ALL_ROADVEHICLES(v) {
+ if (v->First() == v && v->current_order.IsType(OT_GOTO_STATION) &&
v->dest_tile == tile) {
v->dest_tile = v->GetOrderStationLocation(st->index);
}
@@ -1964,11 +1962,9 @@ static CommandCost RemoveAirport(Station *st, DoCommandFlag flags)
CommandCost cost(EXPENSES_CONSTRUCTION, w * h * _price.remove_airport);
- const Vehicle *v;
- FOR_ALL_VEHICLES(v) {
- if (!(v->type == VEH_AIRCRAFT && IsNormalAircraft(v))) continue;
-
- const Aircraft *a = (const Aircraft *)v;
+ const Aircraft *a;
+ FOR_ALL_AIRCRAFT(a) {
+ if (!IsNormalAircraft(a)) continue;
if (a->targetairport == st->index && a->state != FLYING) return CMD_ERROR;
}