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

28436 Commits

Author SHA1 Message Date
Cory Sanin
6fc950d38f Feature: Add optional screenshot argument for Z coord 2025-06-24 00:19:24 +02:00
Matt
d8964c5641 Fix #24509: Use std::sort instead of std::stable_sort (#24664) 2025-06-23 18:46:31 +02:00
OpenRCT2 git bot
d130e0dcc8 Merge Localisation/master into OpenRCT2/develop 2025-06-23 04:11:22 +00:00
Kuan-Wei Chiu
339f3ac755 Fix invalid null comparison in RideList sort comparator
The previous comparator returned false when either rideLhs or rideRhs was a nullptr, in an attempt to avoid null pointer dereference. However, this causes both comp(a, nullptr) and comp(nullptr, a) to return false, which violates the requirements of a strict weak ordering.

As defined in the C++ standard, the comparator used in std::sort must establish a strict weak ordering. This includes the requirement that the equivalence relation defined as
equiv(a, b) := !comp(a, b) && !comp(b, a) must be transitive.

In the original logic, two non-null elements a and b might be ordered such that comp(a, b) == true but if both comp(a, nullptr) and comp(b, nullptr) return false, then equiv(a, nullptr) == true and equiv(b, nullptr) == true, which implies equiv(a, b) == true. This contradicts comp(a, b) == true and violates transitivity of equiv.

Such violations can lead to undefined behavior in std::sort, including invalid memory access or segmentation faults.

Fix the comparator to consistently treat nullptr as greater than any non-null pointer, by returning rideLhs != nullptr when either pointer is null. This restores transitivity and compliance with the C++ standard, ensuring reliable and predictable sorting behavior.
2025-06-22 19:33:57 +02:00
Michael Steenbeek
51a5cff021 Merge pull request #24654 from Gymnasiast/refactor/metal-support-names
Rename members of support enums to lowerCamelCase
2025-06-21 23:31:10 +02:00
Gymnasiast
76ad3715bb Rename enum members of WoodenSupportTransitionType to lowerCamelCase 2025-06-21 14:46:32 +02:00
Gymnasiast
f267d6025b Rename enum members of WoodenSupportSubType to lowerCamelCase 2025-06-21 14:37:55 +02:00
Gymnasiast
38eccc4e2c Rename enum members of WoodenSupportType to lowerCamelCase 2025-06-21 14:36:46 +02:00
Gymnasiast
ed6cd227fc Rename enum members of MetalSupportType to lowerCamelCase 2025-06-21 14:16:40 +02:00
Gymnasiast
939d756244 Rename enum members of MetalSupportGraphic to lowerCamelCase 2025-06-21 14:12:50 +02:00
Gymnasiast
16ce220210 Rename enum members of MetalSupportPlace to lowerCamelCase 2025-06-21 14:12:49 +02:00
Michael Steenbeek
0e015264ae Land edge door animations (#24621)
* Add RCT1 land edge door map animations

* Only animate landscape edge doors if door exists

* Move Vehicle::UpdateLandscapeDoorA function

* Merge Vehicle::UpdateLandscapeDoor functions

* Only animate land edge doors if track is below surface height

* Play door sounds for land edge doors

* Add changelog entry for landscape edge door animations
2025-06-20 16:35:54 +02:00
Michael Steenbeek
c000b93be6 Add first translations batch to NSIS 2025-06-20 12:23:42 +02:00
Michał Janiszewski
68914ea79a 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.
2025-06-19 00:31:30 +02:00
Michael Steenbeek
fb76d1b252 Merge pull request #24629 from janisozaur/hired-boat-division-by-zero
Fix #24617: Prevent hired boat with 0 speed causing division by 0
2025-06-19 00:12:17 +02:00
Gymnasiast
18543caf58 Rename ecx to newAcceleration 2025-06-18 23:40:07 +02:00
Michał Janiszewski
aa519879a7 Fix #24617: Prevent hired boat with 0 speed causing division by 0 2025-06-18 23:38:15 +02:00
Michał Janiszewski
cf72933aa5 Fix #24589: Ride's music tab doesn't redraw in multiplayer
Trigger an invalidation of the window when actually executing the
command.
2025-06-18 23:36:00 +02:00
Matt
4bbb5c4c61 Merge pull request #24534 from mrmbernardi/fix-24527
Fix: [#24527] Minor string artefacts when rebuilding scenario index
2025-06-17 15:57:31 +03:00
Michael Bernardi
b72e2e1c98 Clear stale scenario repo pointers during language change. 2025-06-17 22:42:18 +10:00
Michael Bernardi
1bc0eca74c Remove unused includes 2025-06-17 22:42:13 +10:00
Michael Steenbeek
1222670320 NSIS: disable languages without translations 2025-06-16 21:19:09 +00:00
Michael Steenbeek
7b322d825a Refactor constants in window .cpp files 2025-06-16 23:10:47 +02:00
Michał Janiszewski
0e9982d6ca Drop "Pause game when Steam overlay is open" feature
As shown in https://github.com/OpenRCT2/OpenRCT2/pull/24618, the steam
overlay feature doesn't work well and can cause jarring user experience
in some scenarios. It is only supported in the software renderer and
with code moving steadily to OpenGL, the time has come to remove a
broken feature.
2025-06-16 21:57:56 +02:00
Michał Janiszewski
72a8d25ad7 Make changelog format display diff in unified format (#24631) 2025-06-16 10:38:13 +02:00
mix
9e84dc809a Add changelog entry for landscape edge door animations 2025-06-14 22:29:21 +01:00
mix
14aa6f7fdd Play door sounds for land edge doors 2025-06-14 22:29:21 +01:00
mix
6c011c2a2a Only animate land edge doors if track is below surface height 2025-06-14 22:29:21 +01:00
mix
bbe0ffcc7d Merge Vehicle::UpdateLandscapeDoor functions 2025-06-14 22:29:21 +01:00
mix
eedc93ac52 Move Vehicle::UpdateLandscapeDoorA function 2025-06-14 22:29:21 +01:00
mix
1d89ed818e Only animate landscape edge doors if door exists 2025-06-14 22:29:20 +01:00
mix
d42ee0a062 Add RCT1 land edge door map animations 2025-06-14 21:17:17 +01:00
Michael Steenbeek
28a7e8f02a Merge pull request #24498 from mixiate/refactor-map-animations
Refactor map animations
2025-06-13 23:07:23 +02:00
mix
5e6adfa36c Add changelog entries for refactored map animations 2025-06-13 21:55:28 +01:00
mix
f73a7b64d9 Remove fallthrough annotations in TrackPlaceAction::Execute 2025-06-13 21:13:34 +01:00
mix
8d2309a4c2 Change magic numbers to constants in Viewport::Invalidate function 2025-06-13 21:13:34 +01:00
mix
92dd81b9ea Change tile related magic numbers to consts in map animation code 2025-06-13 21:13:34 +01:00
mix
b56f150533 Change MapAnimations::ShiftAll parameter from CoordsXY to TileCoordsXY 2025-06-13 21:13:34 +01:00
mix
ed4f926d7d Remove RCT1 land edge door map animations 2025-06-13 21:13:34 +01:00
mix
22f3dd429d Change invalidating map animations from set to vector of bools 2025-06-13 21:13:34 +01:00
mix
c7dba755b1 Skip viewport in map animation invalidation if over max zoom 2025-06-13 21:13:34 +01:00
mix
aed3a9cb3b Prevent scrolling text map animations invalidating when not drawn 2025-06-13 21:13:34 +01:00
mix
d6d44f05b9 Raise map animation invalidation max zoom to 2 2025-06-13 21:13:34 +01:00
mix
46e85d4468 Mark auto pointers explicitly in map animations 2025-06-13 21:13:33 +01:00
mix
89f349f6e8 Change MapAnimations::MarkTileForInvalidation parameter to TileCoordsXY 2025-06-13 21:13:33 +01:00
mix
d98a06564a Change MapAnimations::MarkTileForUpdate parameter to TileCoordsXY 2025-06-13 21:13:33 +01:00
mix
9f44a475fd Simplify MapGetTrackElementAtFromRideIsUnderground 2025-06-13 21:13:33 +01:00
mix
dd3e62b56e Pass viewport as pointer in map animations 2025-06-13 21:13:33 +01:00
mix
7100c6b476 Don't update map animations on ticks where nothing is updated 2025-06-13 21:13:33 +01:00
mix
0a63059580 Prevent land edge doors creating animations if not underground 2025-06-13 21:13:33 +01:00