Merge pull request #20415 from ZehMatt/fix-20413

Fix #20413: Crash attempting to navigate an empty console history
This commit is contained in:
Matthias Moninger 2023-06-18 17:14:46 +03:00 committed by GitHub
commit e67fce7e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@
- Fix: [#20260] Ride locks up when inspecting/fixing staff member is fired.
- Fix: [#20262] Title screen music missing when “random” title music is selected and RCT1 is no longer linked.
- Fix: [#20361] Crash when using random map generation.
- Fix: [#20413] Crash when attempting to navigate an empty console history.
0.4.5 (2023-05-08)
------------------------------------------------------------------------

View File

@ -82,7 +82,7 @@ void InGameConsole::Input(ConsoleInput input)
_consoleTextInputSession->SelectionStart = _consoleCurrentLine.size();
break;
case ConsoleInput::HistoryNext:
if (_consoleHistoryIndex < _consoleHistory.size() - 1)
if (_consoleHistoryIndex + 1 < _consoleHistory.size())
{
_consoleHistoryIndex++;
_consoleCurrentLine = _consoleHistory[_consoleHistoryIndex];