summaryrefslogtreecommitdiff
path: root/src/road_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/road_cmd.cpp
parent7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c (diff)
downloadopenttd-5a463c8347fe1e68ab31dda1425e9060d52bfbd6.tar.xz
(svn r16442) -Codechange: use new Vehicle accessors at more places
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 231abebe8..680b8d000 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -37,11 +37,9 @@
*/
bool RoadVehiclesAreBuilt()
{
- const Vehicle *v;
+ const RoadVehicle *rv;
+ FOR_ALL_ROADVEHICLES(rv) return true;
- FOR_ALL_VEHICLES(v) {
- if (v->type == VEH_ROAD) return true;
- }
return false;
}
@@ -274,9 +272,9 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
if (HasRoadWorks(tile)) {
/* flooding tile with road works, don't forget to remove the effect vehicle too */
assert(_current_company == OWNER_WATER);
- Vehicle *v;
- FOR_ALL_VEHICLES(v) {
- if (v->type == VEH_EFFECT && TileVirtXY(v->x_pos, v->y_pos) == tile) {
+ EffectVehicle *v;
+ FOR_ALL_EFFECTVEHICLES(v) {
+ if (TileVirtXY(v->x_pos, v->y_pos) == tile) {
delete v;
}
}
@@ -1540,13 +1538,6 @@ static const byte _roadveh_enter_depot_dir[4] = {
static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int x, int y)
{
switch (GetRoadTileType(tile)) {
- case ROAD_TILE_CROSSING:
- if (v->type == VEH_TRAIN) {
- /* it should be barred */
- assert(IsCrossingBarred(tile));
- }
- break;
-
case ROAD_TILE_DEPOT: {
if (v->type != VEH_ROAD) break;