From e3924f3231d01bb6af4686c66f1e41dc23e44ee7 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 28 Nov 2023 13:52:36 +0000 Subject: [PATCH] Fix #10811: Allow dragging vehicle in depot to any free row. (#11508) --- src/depot_gui.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index e001f2fedb..9eeb51011c 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -460,11 +460,9 @@ struct DepotWindow : Window { ym = (y - matrix_widget->pos_y) % this->resize.step_height; int row = this->vscroll->GetScrolledRowFromWidget(y, this, WID_D_MATRIX); - if (row == INT_MAX) return MODE_ERROR; - uint pos = (row * this->num_columns) + xt; - if (this->vehicle_list.size() + this->wagon_list.size() <= pos) { + if (row == INT_MAX || this->vehicle_list.size() + this->wagon_list.size() <= pos) { /* Clicking on 'line' / 'block' without a vehicle */ if (this->type == VEH_TRAIN) { /* End the dragging */