From 31a1d5259c0f0c975837c69b8c9a383bafba3374 Mon Sep 17 00:00:00 2001 From: Simon Jarrett Date: Fri, 14 Aug 2020 00:52:04 +0100 Subject: [PATCH] Fix #7037: Unable to save tracks starting with a sloped turn or helix --- distribution/changelog.txt | 1 + src/openrct2/ride/Ride.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index dc63de37d1..bd56485a46 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.3.0+ (in development) ------------------------------------------------------------------------ +- Fix: [#7037] Unable to save tracks starting with a sloped turn or helix. - Fix: [#12691] Ride graph tooltip incorrectly used count instead of number string. - Fix: [#12694] Crash when switching ride types with construction window open. - Fix: [#12701] Silent NSIS setup flag /S isn't silent, upgrade pop-up appears anyway. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 1e9bce0ee0..dfca7fdb61 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5366,9 +5366,12 @@ void ride_get_start_of_track(CoordsXYE* output) bool moveSlowIt = true; do { + // Because we are working backwards, begin_element is the section at the end of a piece of track, whereas + // begin_x and begin_y are the coordinates at the start of a piece of track, so we need to pass end_x and + // end_y CoordsXYE lastGood = { - /* .x = */ trackBeginEnd.begin_x, - /* .y = */ trackBeginEnd.begin_y, + /* .x = */ trackBeginEnd.end_x, + /* .y = */ trackBeginEnd.end_y, /* .element = */ trackBeginEnd.begin_element, };