diff --git a/vehicle_gui.c b/vehicle_gui.c index 0b56eb0cbc..f9c977f845 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -1575,9 +1575,16 @@ static void DrawVehicleListWindow(Window *w) default: NOT_REACHED(); } - DrawWindowWidgets(w); + if (owner == _local_player) { + bool list_isempty vl->l.list_length == 0; + + SetWindowWidgetDisabledState(w, VLW_WIDGET_SEND_TO_DEPOT, list_isempty); + SetWindowWidgetDisabledState(w, VLW_WIDGET_AUTOREPLACE, list_isempty); + SetWindowWidgetDisabledState(w, VLW_WIDGET_STOP_ALL, list_isempty); + SetWindowWidgetDisabledState(w, VLW_WIDGET_START_ALL, list_isempty); + } - if (owner == _local_player && vl->l.list_length == 0) DisableWindowWidget(w, 9); + DrawWindowWidgets(w); /* draw sorting criteria string */ DrawString(85, 15, _vehicle_sort_listing[vl->l.sort_type], 0x10);