From 885be637976c052dd20aa0daf0d82ca67d1a6345 Mon Sep 17 00:00:00 2001 From: Bas Date: Sun, 21 Aug 2022 22:08:22 +0200 Subject: [PATCH] Rename subposition rotations to yaw, pitch, roll --- distribution/openrct2.d.ts | 13 +++++++------ src/openrct2/scripting/ScriptEngine.h | 2 +- .../scripting/bindings/ride/ScTrackSegment.h | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index ffd68e89e1..ceb687adf6 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1245,12 +1245,12 @@ declare global { */ readonly elements: TrackSegmentElement[]; - /** + /** * Gets a length of the subpositions list for this track segment. */ getSubpositionLength(subpositionType: number, direction: Direction): number; - /** + /** * Gets all of the subpositions for this track segment. These subpositions are used for the * pathing of vehicles when moving along the track. */ @@ -1281,9 +1281,10 @@ declare global { * A single subposition on a track piece. These subpositions are used for the pathing of vehicles * when moving along the track. */ - interface TrackSubposition extends Readonly { - readonly angle: TrackSlope; - readonly banking: TrackBanking; + interface TrackSubposition extends Readonly { + readonly yaw: number; + readonly pitch: TrackSlope; + readonly roll: TrackBanking; } interface TrackIterator { @@ -1489,7 +1490,7 @@ declare global { /** * The type of subposition coordinates that this vehicle is using to find its - * position on the track. + * position on the track. */ readonly subposition: number; diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index bd18d70a19..f5cbe26a17 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,7 +46,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 58; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 59; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; diff --git a/src/openrct2/scripting/bindings/ride/ScTrackSegment.h b/src/openrct2/scripting/bindings/ride/ScTrackSegment.h index 547705a418..d5791ecce6 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackSegment.h +++ b/src/openrct2/scripting/bindings/ride/ScTrackSegment.h @@ -25,9 +25,9 @@ namespace OpenRCT2::Scripting dukSubposition.Set("x", value.x); dukSubposition.Set("y", value.y); dukSubposition.Set("z", value.z); - dukSubposition.Set("direction", value.direction); - dukSubposition.Set("angle", value.Pitch); - dukSubposition.Set("banking", value.bank_rotation); + dukSubposition.Set("yaw", value.direction); + dukSubposition.Set("pitch", value.Pitch); + dukSubposition.Set("roll", value.bank_rotation); return dukSubposition.Take(); }