Commit Graph
933 Commits
Author SHA1 Message Date
mrmbernardi a64f0eff6c Fix crash when ScPark::generateGuest fails to generate a guest (#26681) 2026-06-16 20:24:53 +02:00
MarcelVos96 86f282f7c0 Add cheat to disable grass growing (#26442) 2026-06-09 23:03:27 +02:00
Stephan SpenglerandTulio Leao bcdac632a4 Add footpath object flags to API (#26322)
* add footpath object flags to API

* Add changelog

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-06-06 16:31:03 -03:00
mgiannopoulos24 ab47bbd5d9 Rename Guest entity members (#26625) 2026-05-30 14:21:37 +00:00
mgiannopoulos24 d85835a0a0 Rename Staff entity members (#26603)
* Rename Staff entity member fields

* Rename Staff entity methods for consistency

* Remove unused EntertainerCostume enum class
2026-05-28 12:28:45 +02:00
mgiannopoulos24 d841b2dcec Rename Litter entity members (#26597)
* Rename Litter entity members

* Rename `Serialise` → `serialise` in all entity types called from GameStateSnapshots.cpp.
2026-05-21 21:21:42 +02: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
Harry Hopkinson 9780eead48 Rename JumpingFountain and move paint code to paint/entity (#26571)
* Move JumpingFountain paint code to paint/entity

* Rename Fountain files to JumpingFountain

* Rename PaintFountain to PaintJumpingFountain
2026-05-20 18:34:41 +02: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 ce23b3c644 Rename Management members (#26530)
* Rename Award members to lowerCamelCase

* Rename MarketingCampaign members to lowerCamelCase

* Rename ResearchItem members to lowerCamelCase

* Rename News::ItemQueues members to lowerCamelCase

* Rename News::ItemQueue members to lowerCamelCase
2026-05-17 14:58:29 +02: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
mgiannopoulos24 11a3a5c373 Rename MoneyEffect members (#26556) 2026-05-17 11:03:11 +00:00
mrmbernardiandTulio Leao 6b81c4efec Fix JS socket issues (#26539)
* Fix Qjs sockets

* Add changelog entry

* Fix changelog ordering

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-05-17 09:45:31 +00:00
Tulio Leao d093945c41 Merge pull request #26558 from alex-parisi/null-socket-fix
Fixing crash when removing null socket
2026-05-16 22:28:49 -03:00
Alex Parisi 9acd252249 Fixing out-of-bounds enum lookup (#26559)
* Fixing out-of-bounds lookup

* Omit unmappable voucher fields
2026-05-16 22:26:55 -03:00
73 08ca5ec987 Fix copyright years in files that state 2025 still (#26540) 2026-05-16 17:51:22 +02:00
mrmbernardiandMichał Janiszewski e4ba212574 Set qjs stack limit to 7MB (#26489)
* Set qjs stack limit to 7MB

* Update distribution/changelog.txt

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>

---------

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>
2026-05-16 17:26:29 +02:00
Alex Parisi 7c0b555629 Move sockets before disposing of them 2026-05-14 14:31:31 -04:00
Alex Parisi 96cb09da9e Fixing crash when removing null socket 2026-05-14 12:27:47 -04:00
Marino Rottier 6e45d802ec Automatically publish plugin types to NPM (#26283)
* add workflow and package.json for publishing plugin TypeScript types

* move scripting-related files to scripting folder

* add support for trusted publishers

* fix path to scripting readme

* rename scripting README.md back to scripting.md

* support tagged/dev releases

* add workflow for development versions

* Update package.json website

* change dependencies in publish-plugin-types

* add timestamp to dev plugin versions

* note ScriptEngine.h grep dependency from CI

* use gh-describe to track release version for dev plugin types
2026-04-28 21:25:57 +02:00
Basssiiieandguysv ce9470971c Expose show/hideGridlines to scripting more safely (#24879)
Co-authored-by: guysv <sviryguy@gmail.com>
2026-04-18 03:37:11 +00:00
Max efb268af7d Add ride breakdown hook for scripting (#24243) 2026-04-18 03:25:23 +00: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
Michał Janiszewski 8d9aec1090 Fix #26304: Use common prototypes for JS entities (#26321)
Previously JS entities would create prototypes on each allocation in
`Sc*::New`. This change creates a single global protype for each entity
class which then gets copied upon entity allocation in JS realm.

Running test with "Live Ride Measurements" plugin on a park shared for
performance testing I get following results:

|                 | OpenRCT2::Scripting::HookEngine::Call | OpenRCT2::Scripting::ScMap::getAllEntities |
|-----------------|---------------------------------------|--------------------------------------------|
| duktape         | 68ms                                  | 10ms                                       |
| quickjs current | 318ms                                 | 126ms                                      |
| quickjs + fix   | 22ms                                  | 942µs                                      |

Previously each call to `getAllEntities` would result in 1382 calls to
`JS_SetPropertyFunctionList`, each costing 90.5µs.

Park used: https://files.catbox.moe/z6j2g4.park
2026-04-05 09:22:47 +02:00
Aaron van Geffen 85b58ceca0 Pass ParkData ref to game actions (#26018)
* Pass ParkData ref to game actions

* Require ParkData& param for most Park functions

* Pass ParkData& param to Award check functions

* Replace a few more instances of indirect ParkData access
2026-04-03 23:36:12 +02:00
Basssiiie cee8fcbee6 Remove some unused includes and simplify some others (#26317) 2026-04-03 23:04:34 +02:00
Michael Bernardi 4c8308464f QuickJS network and plugin version bumps 2026-04-01 12:54:43 +11:00
Michael Bernardi 7aa5a067d1 Review fixes 2026-04-01 02:19:02 +11:00
Michael Bernardi e924c00a0d Fix PluginScope for promises 2026-04-01 02:19:01 +11:00
Michael Bernardi 79e10f98d5 Fix ScSocket 2026-04-01 02:19:01 +11:00
Michael Bernardi 421530c3ea Use class prototypes for all script types. 2026-04-01 02:19:01 +11:00
16cd1c07ff Swap Duktape for quickjs-ng
Co-authored-by: Basssiiie <Basssiiie@users.noreply.github.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-04-01 02:18:36 +11:00
matheusvb3 c6f505e718 Convert small scenery entry flags into a FlagHolder (#26181)
Update Staff.cpp
2026-03-12 21:40:08 +00:00
Gymnasiast f3cec44278 Move TrackTypeIs*() to TrackElemType.{cpp,h} 2026-03-10 18:33:43 +01:00
Aaron van Geffen 586c2edb57 Move entities into OpenRCT2 namespace (#26173) 2026-03-10 07:39:53 +01:00
Michael Steenbeek 0616a38121 Move track iteration code to TrackIteration.{cpp,h} and into a namespace (#26174) 2026-03-09 20:46:31 +00:00
Aaron van Geffen be84cdb1bb Rename Climate to Weather where appropriate (#26163)
* Introduce OpenRCT2::Weather namespace

* Rename Climate.h/cpp to Weather.h/cpp

* Rename ScClimate.hpp to ScWeather.hpp

* Rename drawing/Weather.h to drawing/WeatherDrawer.h
2026-03-08 11:00:07 +01:00
Michael Steenbeek 571745d38f Merge pull request #26129 from Gymnasiast/refactor/track-data-more
Finish move to a TrackElementDescriptor per element
2026-03-08 10:40:57 +01:00
matheusvb3 14862decbe Remove declarations for non-existing functions (#26156) 2026-03-06 16:42:48 +01:00
Michael Steenbeek 966057f35a Create strong enum for Breakdown, FlagHolder for available breakdowns (#26095) 2026-03-02 22:03:35 +01:00
Gymnasiast da7272dec9 Finish move to a TrackElementDescriptor per element 2026-03-02 20:39:35 +01:00
Gymnasiast 8b104d04b3 Rename TrackMetaData to TrackMetadata 2026-03-01 12:40:51 +01:00
Gymnasiast 56082daa5f Split off TrackElementDescriptor and a few other things into their own headers 2026-03-01 12:40:47 +01:00
frozensnowy 011ddc12a4 Improve: Profiler thread safety and JSON export support (#26025)
* Refactor: Profiler thread safety and JSON export support

Refactors the profiling system to be thread safe using lock free atomics for the hot path, adds JSON export with call graph data, and updates the
API to use camelCase naming convention

* Address profiler refactor review feedback

Use a ',' for CSV export and moved implementations to the profiling.cpp to avoid <algorithm> in the header.
2026-02-26 22:30:45 +01:00
Gymnasiast 6440b5d6f3 Rename ‘lifecycleFlags’ to ‘flags’ 2026-02-24 23:31:07 +01:00
Gymnasiast 7d4acdc2c3 Refactor lifecycleFlags to FlagHolder 2026-02-24 23:30:19 +01:00
Aaron van Geffen 001df30eb5 Require ParkData& param for most Park functions 2026-02-13 14:36:05 +01:00
spacek531 281aea6ebe Refactor VehicleFlags to FlagHolder (#26014) 2026-02-13 09:50:54 +00:00
Aaron van Geffen 1cc7006127 Reorganise game actions into folders (#25987) 2026-02-10 08:57:40 +01:00