From 39a37f14ebf0f806cb632cf925ace63de2dc9ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20Paul=20H=C3=B6fer?= <84280965+zzril@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:42:44 +0100 Subject: [PATCH] Fix #21054: `No entrance` style selected by default in track designer --- distribution/changelog.txt | 1 + src/openrct2/EditorObjectSelectionSession.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 88619ef374..e9b6aebd44 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -5,6 +5,7 @@ - Fix: [#20255] Images from the last hovered-over coaster in the object selection are not freed. - Fix: [#20616] Confirmation button in the track designer’s quit prompt has the wrong text. - Fix: [#20628] Moving caret using Ctrl+left can move too far when using a multibyte grapheme. +- Fix: [#21054] “No entrance” style is selected by default in the track designer. - Fix: [#21145] [Plugin] setInterval/setTimeout handle conflict. - Fix: [#21157] [Plugin] Widgets do not redraw correctly when updating disabled or visibility state. - Fix: [#21158] [Plugin] Potential crash using setInterval/setTimeout within the callback. diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 2f6a820758..f20f9cb163 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -483,6 +483,14 @@ void FinishObjectSelection() { SetEveryRideTypeInvented(); SetEveryRideEntryInvented(); + + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + gLastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain"); + if (gLastEntranceStyle == OBJECT_ENTRY_INDEX_NULL) + { + gLastEntranceStyle = 0; + } + gEditorStep = EditorStep::RollercoasterDesigner; GfxInvalidateScreen(); }