1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 01:52:32 +01:00

Fix track origin being miscalculated for plugins on downward slopes

This commit is contained in:
Basssiiie
2025-04-09 19:29:44 +02:00
committed by GitHub
parent 9a897b9633
commit 0ae984842b
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
- Fix: [#21919] Non-recolourable cars still show colour picker.
- Fix: [#23108] Missing pieces on Hypercoaster and Hyper-Twister, even with the all drawable track pieces cheat enabled.
- Fix: [#24013] Failure to load a scenario preview image (minimap) could lead to an uncaught exception error message.
- Fix: [#24142] [Plugin] Track origin is miscalculated on downward slopes.
0.4.21 (2025-04-05)
------------------------------------------------------------------------

View File

@@ -774,7 +774,7 @@ std::optional<CoordsXYZD> GetTrackSegmentOrigin(const CoordsXYE& posEl)
const auto& trackBlock = ted.sequences[sequenceIndex].clearance;
CoordsXY trackBlockOffset = { trackBlock.x, trackBlock.y };
coords += trackBlockOffset.Rotate(DirectionReverse(direction));
coords.z -= trackBlock.z;
coords.z += ted.sequences[0].clearance.z - trackBlock.z;
return CoordsXYZD(coords, direction);
}