summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-12-14 21:26:03 +0000
committerterkhen <terkhen@openttd.org>2010-12-14 21:26:03 +0000
commit79e2b3153d4d89a653a72e07727e58300b435ac4 (patch)
tree62d1f676a9a63df00b92b64d8e866a98b080dc3b /src/vehicle_gui.cpp
parent96b98b392ad89e3d1718a7a46a3e41d4eeab61d3 (diff)
downloadopenttd-79e2b3153d4d89a653a72e07727e58300b435ac4.tar.xz
(svn r21516) -Codechange: Add IsGroundVehicle function to the Vehicle class.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 259528f4a..fec5c1d39 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -435,7 +435,7 @@ struct RefitWindow : public Window {
}
current_index++;
}
- } while ((v->type == VEH_TRAIN || v->type == VEH_ROAD) && (v = v->Next()) != NULL);
+ } while (v->IsGroundVehicle() && (v = v->Next()) != NULL);
int scroll_size = 0;
for (uint i = 0; i < NUM_CARGO; i++) {
@@ -2033,7 +2033,7 @@ static bool IsVehicleRefitable(const Vehicle *v)
do {
if (IsEngineRefittable(v->engine_type)) return true;
- } while ((v->type == VEH_TRAIN || v->type == VEH_ROAD) && (v = v->Next()) != NULL);
+ } while (v->IsGroundVehicle() && (v = v->Next()) != NULL);
return false;
}
@@ -2311,7 +2311,7 @@ public:
CcCloneVehicle);
break;
case VVW_WIDGET_TURN_AROUND: // turn around
- assert(v->type == VEH_TRAIN || v->type == VEH_ROAD);
+ assert(v->IsGroundVehicle());
DoCommandP(v->tile, v->index, 0,
_vehicle_command_translation_table[VCT_CMD_TURN_AROUND][v->type]);
break;
@@ -2345,7 +2345,7 @@ public:
this->SetWidgetDirty(VVW_WIDGET_SELECT_DEPOT_CLONE);
}
/* The same system applies to widget VVW_WIDGET_REFIT_VEH and VVW_WIDGET_TURN_AROUND.*/
- if (v->type == VEH_ROAD || v->type == VEH_TRAIN) {
+ if (v->IsGroundVehicle()) {
PlaneSelections plane = veh_stopped ? SEL_RT_REFIT : SEL_RT_TURN_AROUND;
NWidgetStacked *nwi = this->GetWidget<NWidgetStacked>(VVW_WIDGET_SELECT_REFIT_TURN);
if (nwi->shown_plane + SEL_RT_BASEPLANE != plane) {