Fix #10811: Allow dragging vehicle in depot to any free row. (#11508)

This commit is contained in:
Peter Nelson 2023-11-28 13:52:36 +00:00 committed by GitHub
parent e6d132d24b
commit e3924f3231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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 */