summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 21:49:08 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 21:49:08 +0000
commita407d53d1b2a329a5ae747ea83d4652427cc6c8a (patch)
treeeb86df4a79dffa6270deda722c234ab9cb3c8964 /src/vehicle_gui.cpp
parenta28d33b5dc89e47ae271b5dbdcc4f5e6f1784c6c (diff)
downloadopenttd-a407d53d1b2a329a5ae747ea83d4652427cc6c8a.tar.xz
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 4a5cf7cd2..62b94105a 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1021,7 +1021,7 @@ static void DrawVehicleListWindow(Window *w)
if (w->resize.step_height == PLY_WND_PRC__SIZE_OF_ROW_BIG) DrawSmallOrderList(v, x + 138, y);
- if (IsVehicleInDepot(v)) {
+ if (v->IsInDepot()) {
str = STR_021F;
} else {
str = (v->age > v->max_age - 366) ? STR_00E3 : STR_00E2;
@@ -1546,9 +1546,9 @@ static bool IsVehicleRefitable(const Vehicle *v)
*/
switch (v->type) {
case VEH_TRAIN: return false;
- case VEH_ROAD: return EngInfo(v->engine_type)->refit_mask != 0 && IsVehicleInDepotStopped(v);
- case VEH_SHIP: return ShipVehInfo(v->engine_type)->refittable && IsVehicleInDepotStopped(v);
- case VEH_AIRCRAFT: return IsVehicleInDepotStopped(v);
+ case VEH_ROAD: return EngInfo(v->engine_type)->refit_mask != 0 && v->IsStoppedInDepot();
+ case VEH_SHIP: return ShipVehInfo(v->engine_type)->refittable && v->IsStoppedInDepot();
+ case VEH_AIRCRAFT: return v->IsStoppedInDepot();
default: NOT_REACHED();
}
}
@@ -1790,7 +1790,7 @@ static void VehicleViewWndProc(Window *w, WindowEvent *e)
case WE_MOUSELOOP: {
const Vehicle *v = GetVehicle(w->window_number);
- bool veh_stopped = IsVehicleInDepotStopped(v);
+ bool veh_stopped = v->IsStoppedInDepot();
/* Widget VVW_WIDGET_GOTO_DEPOT must be hidden if the vehicle is already
* stopped in depot.