1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00

Fix #16075: Track designs save scenery in wrong location

This commit is contained in:
ζeh Matt
2021-12-04 03:07:10 -08:00
committed by GitHub
parent 58f30f78d7
commit 7cfb5832c4
4 changed files with 7 additions and 5 deletions

View File

@@ -5318,8 +5318,10 @@ static void TrackDesignCallback(int32_t result, [[maybe_unused]] const utf8* pat
*/
static void WindowRideMeasurementsDesignSave(rct_window* w)
{
TrackDesignState tds{};
Ride* ride = get_ride(w->rideId);
_trackDesign = ride->SaveToTrackDesign();
_trackDesign = ride->SaveToTrackDesign(tds);
if (!_trackDesign)
{
return;
@@ -5327,7 +5329,6 @@ static void WindowRideMeasurementsDesignSave(rct_window* w)
if (gTrackDesignSaveMode)
{
TrackDesignState tds{};
auto errMessage = _trackDesign->CreateTrackDesignScenery(tds);
if (errMessage != STR_NONE)
{

View File

@@ -953,7 +953,7 @@ void Ride::UpdateAll()
OpenRCT2::RideAudio::UpdateMusicChannels();
}
std::unique_ptr<TrackDesign> Ride::SaveToTrackDesign() const
std::unique_ptr<TrackDesign> Ride::SaveToTrackDesign(TrackDesignState& tds) const
{
if (!(lifecycle_flags & RIDE_LIFECYCLE_TESTED))
{
@@ -967,7 +967,6 @@ std::unique_ptr<TrackDesign> Ride::SaveToTrackDesign() const
return nullptr;
}
auto tds = TrackDesignState{};
auto td = std::make_unique<TrackDesign>();
auto errMessage = td->CreateTrackDesign(tds, *this);
if (errMessage != STR_NONE)

View File

@@ -105,6 +105,7 @@ namespace ShelteredSectionsBits
}; // namespace ShelteredSectionsBits
struct TrackDesign;
struct TrackDesignState;
enum class RideMode : uint8_t;
enum class RideStatus : uint8_t;
@@ -356,7 +357,7 @@ public:
static void UpdateAll();
static bool NameExists(std::string_view name, ride_id_t excludeRideId = RIDE_ID_NULL);
[[nodiscard]] std::unique_ptr<TrackDesign> SaveToTrackDesign() const;
[[nodiscard]] std::unique_ptr<TrackDesign> SaveToTrackDesign(TrackDesignState& tds) const;
uint64_t GetAvailableModes() const;
const RideTypeDescriptor& GetRideTypeDescriptor() const;