summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-11-24 13:50:29 +0000
committersmatz <smatz@openttd.org>2007-11-24 13:50:29 +0000
commitce8d9b7fecf1db65ac8e15af1c8be953b9f06697 (patch)
tree9b3edc5a337eaa2da42efb4e3bb31c140ba1197e /src/depot_gui.cpp
parentb53aa55ade80867fd698f8e4066e9988d9dd8b04 (diff)
downloadopenttd-ce8d9b7fecf1db65ac8e15af1c8be953b9f06697.tar.xz
(svn r11513) -Codechange: enumerize some depot GUI actions
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index d0329597d..0fe361861 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -290,14 +290,14 @@ struct GetDepotVehiclePtData {
Vehicle *wagon;
};
-enum {
- MODE_ERROR = 1,
- MODE_DRAG_VEHICLE = 0,
- MODE_SHOW_VEHICLE = -1,
- MODE_START_STOP = -2,
+enum DepotGUIAction {
+ MODE_ERROR,
+ MODE_DRAG_VEHICLE,
+ MODE_SHOW_VEHICLE,
+ MODE_START_STOP,
};
-static int GetVehicleFromDepotWndPt(const Window *w, int x, int y, Vehicle **veh, GetDepotVehiclePtData *d)
+static DepotGUIAction GetVehicleFromDepotWndPt(const Window *w, int x, int y, Vehicle **veh, GetDepotVehiclePtData *d)
{
Vehicle **vl = WP(w, depot_d).vehicle_list;
uint xt, row, xm = 0, ym = 0;
@@ -411,10 +411,10 @@ static void DepotClick(Window *w, int x, int y)
{
GetDepotVehiclePtData gdvp;
Vehicle *v = NULL;
- int mode = GetVehicleFromDepotWndPt(w, x, y, &v, &gdvp);
+ DepotGUIAction mode = GetVehicleFromDepotWndPt(w, x, y, &v, &gdvp);
/* share / copy orders */
- if (_thd.place_mode != VHM_NONE && mode <= 0) {
+ if (_thd.place_mode != VHM_NONE && mode != MODE_ERROR) {
_place_clicked_vehicle = (WP(w, depot_d).type == VEH_TRAIN ? gdvp.head : v);
return;
}