Commit Graph
23285 Commits
Author SHA1 Message Date
Gymnasiast f7e4eea86d Update Backtrace token for v0.5.0 2026-04-12 10:56:00 +02:00
Michał Janiszewski a89b1e40ca Fix unguarded access to shop items (#26339) 2026-04-07 21:48:30 +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
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
Kennedy McCarthy 357cadb12a Changed default FoothpathSlope (#26289)
Changed default FoothpathSlope in ScenarioPatcher so that builds work on Xcode 15
2026-04-03 23:59:50 +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
Sjoerd de Bruin 1653e167bb Fix #26306: Check Homebrew paths when FindApp fails on macOS (#26307)
Fixes #26306, this allowed the set-up process to continue on my system.
2026-04-03 23:22:36 +02:00
Michael Steenbeek 6f8533462a Merge pull request #26293 from Gymnasiast/feature/write-dat-header
Write DAT filenames with flags and checksum
2026-04-03 23:12:08 +02:00
Basssiiie cee8fcbee6 Remove some unused includes and simplify some others (#26317) 2026-04-03 23:04:34 +02:00
Gymnasiast bf4d42b9bd Write out flags and checksums when exporting DAT files 2026-04-03 23:03:39 +02:00
Gymnasiast 304f211ca4 Remove unused WritePackedObject function 2026-04-03 23:02:32 +02:00
Michał Janiszewski 02c18b61b6 Fix #26300: Image data has its type incorrectly validated (#26302) 2026-04-02 06:59:39 +02:00
Michael Bernardi 4c8308464f QuickJS network and plugin version bumps 2026-04-01 12:54:43 +11:00
Michał Janiszewski 8441958de4 Restore JS_GetPendingJobContext
See https://github.com/quickjs-ng/quickjs/pull/1419
2026-03-31 18:17:37 +02:00
Michał Janiszewski c9a15b7696 Update qjsng to v0.13.0 2026-03-31 18:17:37 +02:00
Michael Bernardi e0c531f362 Fix potential null deref warning 2026-04-01 02:28:59 +11:00
Michael Bernardi 3dbc8bd948 8MB stack for all windows configs 2026-04-01 02:19:02 +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 99dee55494 Fix JSDrawCustomImage using wrong ctx 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
Michael Bernardi f9efdceca9 Fix windows build. 2026-04-01 02:19:01 +11:00
Michael Bernardi 836e4d7834 More stack for windows x64 dbg builds 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
Aaron van Geffen 3d71bd9b48 Disable vehicle preview/recolour if no vehicles are recolourable 2026-03-13 09:40:58 +01:00
Aaron van Geffen 14d8f35f31 Minor tweaks to station style and ride price label positions 2026-03-12 23:23:28 +01:00
Aaron van Geffen 05bfc8915c Resize colour panel to fit widgets 2026-03-09 22:23:32 +01:00
Aaron van Geffen dd6e4059ea Reposition colour tab widgets dynamically 2026-03-09 21:57:56 +01:00
Aaron van Geffen 0fe21876fc Split ColourOnPrepareDraw into smaller sub-functions 2026-03-09 20:18:36 +01:00
frozensnowy 06eb448445 Fix #25927: Wall drag tool error sound stacks and shows wrong cost (#25929)
Query all tiles before execution to calculate total cost and detect errors upfront. Show a single combined error with the accumulated total cost instead of per tile errors with stacking sounds
2026-03-28 23:40:42 +00:00
frozensnowy c3ffee33df Fix #25926: Path drag tool shows cost for single tile instead of total
Query all tiles before execution to calculate total cost and detect errors upfront. It now shows a single combined error with the accumulated total cost for insufficient funds instead of per tile errors
2026-03-29 00:05:36 +01:00
frozensnowy 7cd1c42a60 Fix #25919: Path drag tool error sound stacks when placement fails
Disable error window sound during the placement loop and play the error sound once at the end if all tiles failed. This prevents the sound from stacking when multiple tiles fail simultaneously.
2026-03-29 00:05:09 +01:00
mix 710b4a0059 Add general support height to TED and use in trackPaintGeneric (#26281) 2026-03-28 23:39:26 +01:00
Michael Steenbeek 4d569c48d6 Fix #26270: Building a ride crashes the game (#26278) 2026-03-28 01:17:32 +01:00
mix c815fb9501 Add support height to TED and use in trackPaintGeneric (#26265) 2026-03-27 20:52:06 +01:00
Daniel Rödl b8ea3ac814 Fix OpenRCT2#25128: Mute button is displayed in the wrong state (#26229) 2026-03-27 20:48:53 +01:00
Gymnasiast 2e7e429516 Replace drawText* calls that pass STR_STRING + formatter 2026-03-26 17:10:50 +01:00
Gymnasiast 49fa735600 Do not run drawText* through formatter if there are no arguments 2026-03-26 16:00:06 +01:00
Aaron van Geffen 5c98d62c8f Rename ttfDrawString to match code style 2026-03-26 12:59:54 +01:00
Aaron van Geffen 8ed4b34907 Move includes out of Drawing.h and into their actual users 2026-03-26 12:55:37 +01:00
Gymnasiast a5c32ab60c Rename DrawText* to drawText* 2026-03-25 23:16:25 +01:00
Gymnasiast 2398d91fb2 Rename DrawTextBasic() to DrawText() 2026-03-25 23:15:49 +01:00
Gymnasiast 258b10ba13 Merge DrawText() and DrawTextBasic() 2026-03-25 23:14:58 +01:00
Gymnasiast cb40775d6d Replace DrawTextNoFormatting() with a flag 2026-03-25 23:14:58 +01:00
Gymnasiast ec48edd24b Move text underline to a flag 2026-03-25 23:14:58 +01:00
Gymnasiast 787a57b325 Rename members of TextPaint 2026-03-25 23:14:57 +01:00
Gymnasiast 8b11cccdbf Use ScreenCoordsXY in TextDrawInfo 2026-03-25 23:14:57 +01:00
Gymnasiast dd45a91020 Pass TextDrawInfo as reference 2026-03-25 23:14:57 +01:00
Gymnasiast 619487618a Make gTextPalette internal to Drawing.String.cpp 2026-03-25 23:14:57 +01:00