diff options
author | rubidium <rubidium@openttd.org> | 2007-08-29 21:49:08 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-29 21:49:08 +0000 |
commit | a407d53d1b2a329a5ae747ea83d4652427cc6c8a (patch) | |
tree | eb86df4a79dffa6270deda722c234ab9cb3c8964 /src/vehicle_gui.cpp | |
parent | a28d33b5dc89e47ae271b5dbdcc4f5e6f1784c6c (diff) | |
download | openttd-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.cpp | 10 |
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. |