From 58ac17d649d4fe9c5942ad184cb691c7f46599f2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 29 Sep 2019 22:53:41 +0200 Subject: [PATCH] Fix #10028: Saved park--brakes all set to 0mph --- src/openrct2/rct1/S4Importer.cpp | 12 ++++++++++-- src/openrct2/rct2/S6Importer.cpp | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 33ed51fe1000..b7709065a4f6 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2128,8 +2128,16 @@ class S4Importer final : public IParkImporter dst2->SetDoorBState(src2->GetDoorBState()); dst2->SetStationIndex(src2->GetStationIndex()); dst2->SetHasGreenLight(src2->HasGreenLight()); - dst2->SetBrakeBoosterSpeed(src2->GetBrakeBoosterSpeed()); - dst2->SetPhotoTimeout(src2->GetPhotoTimeout()); + + auto trackType = dst2->GetTrackType(); + if (track_element_has_speed_setting(trackType)) + { + dst2->SetBrakeBoosterSpeed(src2->GetBrakeBoosterSpeed()); + } + else if (trackType == TRACK_ELEM_ON_RIDE_PHOTO) + { + dst2->SetPhotoTimeout(src2->GetPhotoTimeout()); + } if (_s4.rides[src2->GetRideIndex()].type == RIDE_TYPE_MAZE) { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 945435067353..894eb069d86c 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1056,8 +1056,16 @@ class S6Importer final : public IParkImporter dst2->SetInverted(src2->IsInverted()); dst2->SetStationIndex(src2->GetStationIndex()); dst2->SetHasGreenLight(src2->HasGreenLight()); - dst2->SetBrakeBoosterSpeed(src2->GetBrakeBoosterSpeed()); - dst2->SetPhotoTimeout(src2->GetPhotoTimeout()); + + auto trackType = dst2->GetTrackType(); + if (track_element_has_speed_setting(trackType)) + { + dst2->SetBrakeBoosterSpeed(src2->GetBrakeBoosterSpeed()); + } + else if (trackType == TRACK_ELEM_ON_RIDE_PHOTO) + { + dst2->SetPhotoTimeout(src2->GetPhotoTimeout()); + } // Skipping IsHighlighted() auto rideType = _s6.rides[src2->GetRideIndex()].type;