diff --git a/distribution/changelog.txt b/distribution/changelog.txt index bed78500d3..a2e3d450a4 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.2.5+ (in development) ------------------------------------------------------------------------ +- Fix: [#11027] Third color on walls becomes black when saving. 0.2.5 (2020-03-24) ------------------------------------------------------------------------ diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 6833e754e1..10fa61fbc8 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1552,11 +1552,15 @@ void S6Exporter::ExportTileElement(RCT12TileElement* dst, TileElement* src) dst2->SetAcrossTrack(src2->IsAcrossTrack()); dst2->SetAnimationIsBackwards(src2->AnimationIsBackwards()); - auto bannerIndex = src2->GetBannerIndex(); - if (bannerIndex != BANNER_INDEX_NULL) - dst2->SetBannerIndex(bannerIndex); - else - dst2->SetBannerIndex(RCT12_BANNER_INDEX_NULL); + auto entry = src2->GetEntry(); + if (entry != nullptr && entry->wall.scrolling_mode != SCROLLING_MODE_NONE) + { + auto bannerIndex = src2->GetBannerIndex(); + if (bannerIndex != BANNER_INDEX_NULL) + dst2->SetBannerIndex(bannerIndex); + else + dst2->SetBannerIndex(RCT12_BANNER_INDEX_NULL); + } break; } @@ -1570,11 +1574,15 @@ void S6Exporter::ExportTileElement(RCT12TileElement* dst, TileElement* src) dst2->SetPrimaryColour(src2->GetPrimaryColour()); dst2->SetSecondaryColour(src2->GetSecondaryColour()); - auto bannerIndex = src2->GetBannerIndex(); - if (bannerIndex != BANNER_INDEX_NULL) - dst2->SetBannerIndex(bannerIndex); - else - dst2->SetBannerIndex(RCT12_BANNER_INDEX_NULL); + auto entry = src2->GetEntry(); + if (entry != nullptr && entry->large_scenery.scrolling_mode != SCROLLING_MODE_NONE) + { + auto bannerIndex = src2->GetBannerIndex(); + if (bannerIndex != BANNER_INDEX_NULL) + dst2->SetBannerIndex(bannerIndex); + else + dst2->SetBannerIndex(RCT12_BANNER_INDEX_NULL); + } break; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5a0e02bcd8..1ee6d33c59 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1166,11 +1166,11 @@ public: dst2->SetSecondaryColour(src2->GetSecondaryColour()); dst2->SetTertiaryColour(src2->GetTertiaryColour()); dst2->SetAnimationFrame(src2->GetAnimationFrame()); - dst2->SetBannerIndex(src2->GetBannerIndex()); dst2->SetAcrossTrack(src2->IsAcrossTrack()); dst2->SetAnimationIsBackwards(src2->AnimationIsBackwards()); // Import banner information + dst2->SetBannerIndex(BANNER_INDEX_NULL); auto entry = dst2->GetEntry(); if (entry != nullptr && entry->wall.scrolling_mode != SCROLLING_MODE_NONE) { @@ -1180,10 +1180,7 @@ public: auto srcBanner = &_s6.banners[bannerIndex]; auto dstBanner = GetBanner(bannerIndex); ImportBanner(dstBanner, srcBanner); - } - else - { - dst2->SetBannerIndex(BANNER_INDEX_NULL); + dst2->SetBannerIndex(src2->GetBannerIndex()); } } break; @@ -1197,9 +1194,9 @@ public: dst2->SetSequenceIndex(src2->GetSequenceIndex()); dst2->SetPrimaryColour(src2->GetPrimaryColour()); dst2->SetSecondaryColour(src2->GetSecondaryColour()); - dst2->SetBannerIndex(src2->GetBannerIndex()); // Import banner information + dst2->SetBannerIndex(BANNER_INDEX_NULL); auto entry = dst2->GetEntry(); if (entry != nullptr && entry->large_scenery.scrolling_mode != SCROLLING_MODE_NONE) { @@ -1209,10 +1206,7 @@ public: auto srcBanner = &_s6.banners[bannerIndex]; auto dstBanner = GetBanner(bannerIndex); ImportBanner(dstBanner, srcBanner); - } - else - { - dst2->SetBannerIndex(BANNER_INDEX_NULL); + dst2->SetBannerIndex(src2->GetBannerIndex()); } } break;