diff options
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r-- | vehicle_gui.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c index dd9b39154..b79ae41d6 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -1268,6 +1268,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e) SetDParam(0, p->name_1); SetDParam(1, p->name_2); SetDParam(2, w->vscroll.count); + if (vl->list_length == 0) SETBIT(w->disabled_state, 9); if (vehicle_type == VEH_Aircraft) { w->widget[9].unkA = STR_SEND_TO_HANGARS; w->widget[9].tooltips = STR_SEND_TO_HANGARS_TIP; @@ -1404,35 +1405,34 @@ void PlayerVehWndProc(Window *w, WindowEvent *e) } } break; - case 9: /* Left button */ + case 9: { /* Left button */ + uint16 window_type = w->window_number & VLW_FLAGS; if (GB(w->window_number, 0, 8) /* OwnerID */ != _local_player) break; - { - uint16 window_type = w->window_number & VLW_FLAGS; - switch (window_type) { - case VLW_STANDARD: - case VLW_SHARED_ORDERS: { - /* Send to depot */ - const Vehicle *v; - assert(vl->list_length != 0); - v = vl->sort_list[0]; - DoCommandP(v->tile, v->index, window_type | _ctrl_pressed ? 3 : 2, NULL, CMD_SEND_TO_DEPOT(vehicle_type)); - break; - } - - case VLW_STATION_LIST: - /* Build new Vehicle */ - switch (vehicle_type) { - case VEH_Train: ShowBuildTrainWindow(0); break; - case VEH_Road: ShowBuildRoadVehWindow(0); break; - case VEH_Ship: ShowBuildShipWindow(0); break; - case VEH_Aircraft: ShowBuildAircraftWindow(0); break; - default: NOT_REACHED(); break; - } - break; - default: NOT_REACHED(); break; + switch (window_type) { + case VLW_STANDARD: + case VLW_SHARED_ORDERS: { + /* Send to depot */ + const Vehicle *v; + assert(vl->list_length != 0); + v = vl->sort_list[0]; + DoCommandP(v->tile, v->index, window_type | _ctrl_pressed ? 3 : 2, NULL, CMD_SEND_TO_DEPOT(vehicle_type)); + break; } - break; + + case VLW_STATION_LIST: + /* Build new Vehicle */ + switch (vehicle_type) { + case VEH_Train: ShowBuildTrainWindow(0); break; + case VEH_Road: ShowBuildRoadVehWindow(0); break; + case VEH_Ship: ShowBuildShipWindow(0); break; + case VEH_Aircraft: ShowBuildAircraftWindow(0); break; + default: NOT_REACHED(); break; + } + break; + default: NOT_REACHED(); break; } + break; + } case 10: /* Right button */ ShowReplaceVehicleWindow(vehicle_type); |