1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Prevent unfollowing vehicles in viewports other than main

Some viewports, like the one in the guest window or the ride window, are
solely for the purpose of following a sprite. User could still try
RMB-dragging in those windows, which would result in the viewport no
longer following the sprite, but also not scrolling and simply getting
stuck at whatever the latest position was. This change prevents allowing
those viewports from unfollowing a sprite.
This commit is contained in:
Michał Janiszewski
2025-06-19 00:31:30 +02:00
committed by GitHub
parent fb76d1b252
commit 68914ea79a
2 changed files with 8 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
- Fix: [#24589] Music tab doesnt fully render in multiplayer.
- Fix: [#24615] Blank strings in Windows installer.
- Fix: [#24617] Divide by zero error when updating boat hire acceleration.
- Fix: [#24626] Viewports that only follow sprites (e.g. in the Ride and Guest windows) can be made to unfollow them.
0.4.23 (2025-06-07)
------------------------------------------------------------------------

View File

@@ -551,7 +551,13 @@ namespace OpenRCT2
ContextHideCursor();
}
// Only unfollow sprites for the main window or extra viewport windows.
// Dont unfollow for windows where the viewport is always supposed to follow (e.g. Ride, Guest, Staff).
auto mainWindow = WindowGetMain();
if (&w == mainWindow || w.classification == WindowClass::Viewport)
{
WindowUnfollowSprite(w);
}
// gInputFlags.set(InputFlag::unk5);
}