Commit Graph
1028 Commits
Author SHA1 Message Date
Aaron van Geffen e56c1de947 Revert fix for malformed mapRequest decoding (#26797)
This reverts commit 8e64399c50 (#26555).
2026-07-16 22:17:13 +02:00
KushidaandTulio Leao 02c42246fe Fix negative marketing campaign durations (#26789)
* fix: reject non-positive marketing durations

* Bump network version

---------

Co-authored-by: Tulio Leao <tupscal@pm.me>
2026-07-16 11:01:00 +00:00
Alex Parisi 8e64399c50 Fix malformed mapRequest decoding (#26555)
* Fix malformed packet unpacking

* Make mapRequest require authentication

* Add tests for malformed packet decoding

* Fix tests

* clang-tidy

* clang-format

* Use unique ports for network tests

* Serialize network tests instead

* Load park for stricter tests

* Serialize network tests again

* Renaming
2026-07-16 07:49:00 -03:00
MarcelVos96 a85b40b3ef Fix #26775: Maze gets wrong intensity boost from size (#26776)
Intensity boost was 0.02 per tile instead of 0.01 per 2 tiles.
2026-07-11 16:30:12 +00:00
Aaron van Geffen bd3d24b181 Add clarification around GameLoadInit calls 2026-06-27 14:59:08 +02:00
Michael Steenbeek f4f66c9b79 Make CLI exit code into strong enum (#26723) 2026-06-26 22:43:32 +02:00
Gymnasiast 0833b474c4 Always set G1Flag::hasTransparency (bit 0) when importing an image
RCT1/2 always set this flag when an entry is an image of any sort (as opposed to a palette entry). It may be misnamed, as both regular and compressed/"RLE" images support transparency.

This modifies a single bit in the example.dat file, as expected. For convenience:

2c2
< 00000010: 0000 0000 0400 0000 0001 0501 0a01 0f01  ................
---
> 00000010: 0000 0000 0500 0000 0001 0501 0a01 0f01  ................
2026-06-24 12:34:04 +02:00
MarcelVos96 45e30a559a Fix the boosts/penalties to excitement and nausea that air time provides (#26505)
* Fix air time calculations

* Bump kStreamVersion

* Update rating tests

* Update replay bundle
2026-06-11 09:27:23 +00:00
mgiannopoulos24 ab47bbd5d9 Rename Guest entity members (#26625) 2026-05-30 14:21:37 +00:00
Harry Hopkinson 8ce9661dc9 Rename more enum members to lowerCamelCase (#26608)
* Rename enums in Cheats.h

* Rename enums in Diagnostic.h

* Rename enums in Editor.h

* Rename enums in Input.h

* Rename enums in OpenRCT2.h

* Rename enums in ConfigTypes.h

* Rename enums in Identifier.hpp
2026-05-28 10:54:24 +00:00
Harry Hopkinson 9d5e532064 Rename enum members to lowerCamelCase in actions/ (#26593)
* Rename enums in LoadOrQuitAction.h

* Rename enums in ScenarioSetSettingAction.h

* Rename enums in TileModifyAction.h

* Rename enums in NetworkModifyGroupAction.h

* Rename enums in LandBuyRightsAction.h

* Rename enums in LandSetRightsAction.h

* Rename enums in ParkSetParameterAction.h

* Rename enums in PeepPickupAction.h

* Rename enums in StaffSetPatrolAreaAction.h

* Rename enums in RideFreezeRatingAction.h

* Rename enums in RideSetAppearanceAction.h

* Rename enums in RideSetSettingAction.h

* Rename enums in RideSetVehicleAction.h

* Rename enums in BannerSetStyleAction.h
2026-05-21 19:16:07 +00:00
Marino Rottier 6c6acd527b Rename TileElementBase members (#26522)
* Rename TileElementBase members to camelCase

* Rename RCT12TileElementBase and RCT12TileElement members to camelCase
2026-05-17 13:21:16 +00:00
Marino Rottier c9ba4eee98 Rename Network members (#26523)
* Rename Network::Player members to camelCase

* Rename Network::NetworkGroup members to camelCase

* Rename Network::Connection members to camelCase

* Rename NetworkServerAdvertiser members to camelCase

* Rename NetworkAction members to camelCase

* Rename NetworkActions members to camelCase

* Rename Network::User members to camelCase

* Rename Network::UserManager members to camelCase

* Rename PacketLegacyHeader members to camelCase

* Rename Network::Packet members to camelCase
2026-05-17 12:57:47 +00:00
Marino Rottier 66e1411d84 Rename EntityBase and EntitySpriteData members (#26520)
* Rename EntitySpriteData members to camelCase

* Rename EntityBase members to camelCase
2026-05-17 11:21:59 +00:00
Michał Janiszewski e694091be9 Merge pull request #26554 from janisozaur/network-fix-missing-player
Make server drop connections without expected player data
2026-05-17 01:52:50 +02:00
73 08ca5ec987 Fix copyright years in files that state 2025 still (#26540) 2026-05-16 17:51:22 +02:00
Michał Janiszewski e33a914e90 Add test for network connection missing player 2026-05-12 21:52:57 +02:00
Marino Rottier 45ff80d890 Refactor widget state to single storage model (#26443)
* Allow flag/bitmask coexistence in readers

* Add factory helpers and bulk setters for per-widget flags

* Switch coexistence from OR-both to per-window opt-in

* Migrate seven small windows to per-widget flags

* Migrate seven more windows to per-widget flags

* Migrate Cheats, MapGen and Footpath to per-widget flags

* Fix #26421: scenery tab highlight wraps when there are 64+ groups

* Migrate Ride window to per-widget flags

* Migrate ride and maze construction windows to per-widget flags

* Migrate six more windows to per-widget flags

* Migrate Banner, EditorScenarioOptions and RideList to per-widget flags

* Migrate SceneryScatter and LoadSave to per-widget flags

* Migrate EditorObjectSelection, GameBottomToolbar, Guest, Map, NewRide and Park to per-widget flags

* Migrate TopToolbar, TrackList, Research, Player and Options to per-widget flags

* Opt in remaining windows to per-widget flags

* Narrow getters and setters to per-widget flags

* Remove bitmask fields and useWidgetFlags switch

* Restore switch statements for tab/density pressed state

* Add makeHoldableSpinnerWidgets to drop per-page loops

* Update tests for per-widget flag storage

* Add changelog entry for #26421

* Reword narrative-tense comments from the migration

* Fix clang-format violations

* Remove dead holdable-widget tables from Park and Finances
2026-04-28 09:26:02 +02:00
Michał Janiszewski 0da634d6e7 Fix #26310: crash when multiple subscribers register for the same event (#26315)
The scripting engine's `ExecutePluginCall` by default frees its `JSValue` arguments.
When `HookEngine::Call` iterates over multiple subscribers, the first call would free
the argument, leaving subsequent subscribers with an invalid pointer (use-after-free).

This commit fixes the issue by duplicating the `JSValue` for each subscriber and
ensuring the original value is correctly managed based on the `keepArgsAlive` flag.

A new C++ headless test `ScriptingTests.cpp` is added to verify the fix and prevent
future regressions.
2026-04-05 19:57:00 +02:00
Eve SilfanusandMichał Janiszewski 52d7e1833b Build Performance Optimization (#26015)
* Build Performance Optimization

* Fixed include order formatting

* Reverted CMakeLists.txt

* Fixed pch implementation

* Removed cmake pch

* Update test/tests/CMakeLists.txt

---------

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>
2026-02-24 11:39:15 +01:00
frozensnowy 8ff9efa3a1 Fix #25963: Crash when loading corrupted saves with duplicate entity indices (#25980)
Corrupted RCT1/RCT2 save files may contain entities with duplicate or invalid EntityIndex values and when importing these saves, CreateEntityAt returns nullptr for duplicate indices, causing a null pointer dereference crash in ImportEntityCommonProperties, this sanitises each entity's (entities?) EntityIndex to match its array position, so that CreateEntityAt always succeeds. Added unit tests too for just this case, with a crashing save file.
2026-02-12 13:33:06 +00:00
Aaron van Geffen 1cc7006127 Reorganise game actions into folders (#25987) 2026-02-10 08:57:40 +01:00
Aaron van Geffen 773ba479cd Create separate unit for GameActionRunner 2026-02-09 16:06:56 +01:00
frozensnowy b3217703fe Fix #25910: Folders starting with numbers sort incorrectly (#25914)
Commit 43f7d2d91 introduced a regression where logicalCmp compared digit starting strings lexicographically instead of numerically, causing folders to sort as "1, 10, 11, 2..." instead of "1, 2... 10, 11". This commit removes the broken special case,  the main loop already handles
numeric comparison correctly
2026-02-05 21:50:21 +01:00
matheusvb3 e7246eb2f1 Remove redundant negation in a few expressions (#25940) 2026-02-03 20:51:12 +01:00
matheusvb3 c7efa777f7 Remove deprecated C headers (#25921) 2026-02-02 12:41:50 +01:00
matheusvb3 dcba4cb099 Remove redundant namespaces qualifiers (#25837) 2026-01-23 21:46:08 +00:00
matheusvb3 42d69af5b5 Add missing include guards
These were being used in multiple files all throughout the codebase!
2026-01-16 12:43:59 -03:00
matheusvb3 f6cbfb91f8 Remove stray semicolons after declarations 2026-01-16 12:43:59 -03:00
matheusvb3 6ce7379d9b Remove redundant namespace qualifiers from tests project 2026-01-07 21:04:15 -03:00
matheusvb3 e209a3d733 Remove superfluous includes from /test/tests folder (#25766) 2026-01-07 14:47:52 +01:00
Aaron van Geffen b5cd780b3e Rework drawing header includes (#25744)
* Move Csg unit into OpenRCT2 namespace

* Move G1Element into its own header file

* Clean up SpriteCommands.h

* Add trailing namespace comment to Csg.cpp

* Remove Drawing.h dependency from Graph.h

* Add <memory> include to G1Element.h

* Remove Drawing.h include from ImageTable.h (used by all objects!)

* Drop Drawing.h dependency from OpenGLFramebuffer.h

* Drop Drawing.h dependency from TextureCache.h

* Drop Drawing.h include from TitleScene.h

* Drop Drawing.h dependency from Widget.h

* Add <optional> include to SpriteFile.h

* Add Drawing.h to PlayTests, S6ImportExportTests

* Include <cstdint> in TitleScene.h for SIZE_MAX
2026-01-05 19:09:34 +00:00
Gymnasiast e6fa262b9e Rename G1Element members, add unions for palette entries 2025-12-27 16:56:54 +01:00
Michael Steenbeek 355bb5d58d Refactor GAME_COMMAND_FLAG_* to enum+FlagHolder 2025-12-11 00:12:21 +01:00
Kirill Gusev b1103708ea Show error message when issuing replay_start with a nonexistent file 2025-12-09 08:56:08 +01:00
Gymnasiast 0451c8775b Update expected ride ratings in test data for LIM Launched changes 2025-11-09 13:41:51 +01:00
Gymnasiast 57e65f5888 Rename members of RCT2LanguageId 2025-10-07 20:46:11 +02:00
Gymnasiast 890b8137ba Rename members of FormatToken 2025-10-07 20:27:03 +02:00
Gymnasiast 8457be26e9 Rename members of CurrencyType 2025-10-07 20:24:44 +02:00
Gymnasiast daa4fe8ac3 Rename field of all config categories 2025-10-07 20:21:32 +02:00
Gymnasiast 159dc7aab0 Rename members of PeepState 2025-10-05 14:46:12 +02:00
ζeh Matt 518a75f30d Parsing floats/doubles currently unsupported 2025-09-29 13:12:24 +03:00
ζeh Matt 9eeaf9a001 Rename parse to tryParse, add throwing version, return views for split 2025-09-28 23:07:29 +03:00
ζeh Matt 725b3782bd Add tests for String::parse 2025-09-28 22:35:11 +03:00
ζeh Matt 43f7d2d912 Fix logicalCmp not sorting in natural order, refactor the entire thing 2025-09-27 20:21:30 +03:00
Michael Steenbeek a73bf7a2c7 Split CLI commands into their own files (#25241) 2025-09-24 15:43:25 +02:00
Aaron van Geffen 531cb68727 RideManager: use explicit game state rather than using implicit global 2025-09-11 13:42:18 +02:00
Aaron van Geffen 832a1d1f74 Move localisation units into OpenRCT2 namespace 2025-09-11 22:11:12 +02:00
Aaron van Geffen 4446ff9f6f Pass game state ref as parameter to game actions (#25065) 2025-09-08 16:21:29 +02:00
Aaron van Geffen 12ab9195b6 Rework EntityRegistry into class 2025-08-31 14:29:36 +02:00