Prevent invalid filename due to off-by-one in file browser (#1102)

This commit is contained in:
Aaron van Geffen 2021-08-11 23:16:49 +02:00 committed by GitHub
parent 8026daa22c
commit 44f5210c2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- Fix: [#1070] Crash when naming stations after exhausting natural names.
- Fix: [#1094] Repeated clicking on construction window not always working.
- Fix: [#1095] Individual expenses are drawn in red, not just the expenditure sums.
- Fix: [#1102] Invalid file error when clicking empty space in file browser.
- Change: [#298] Planting clusters of trees now costs money and influences ratings outside of editor mode.
- Change: [#1079] Allow rotating buildings in town list by keyboard shortcut.

View File

@ -295,7 +295,7 @@ namespace OpenLoco::Ui::Windows::PromptBrowse
static void onScrollMouseDown(Window* self, int16_t x, int16_t y, uint8_t scrollIndex)
{
auto index = y / self->row_height;
if (index > _numFiles)
if (index >= _numFiles)
return;
Audio::playSound(Audio::SoundId::clickDown, self->x + (self->width / 2));