From 483fb173f5bd0304fe4defb16df6b49cf36cda8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:06:29 +0300 Subject: [PATCH] Adjust S6 import/export for different thought item type --- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index be4005d824..99649fcd5b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1342,7 +1342,7 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src) auto srcThought = &src->Thoughts[i]; auto dstThought = &dst->thoughts[i]; dstThought->type = static_cast(srcThought->type); - dstThought->item = srcThought->item; + dstThought->item = static_cast(srcThought->item); dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d331e309ad..0bf43eb635 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1721,7 +1721,10 @@ template<> void S6Importer::ImportEntity(const RCT12SpriteBase& baseSrc) auto srcThought = &src->thoughts[i]; auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->type); - dstThought->item = srcThought->item; + if (srcThought->item == 0xFF) + dstThought->item = PeepThoughtItemNone; + else + dstThought->item = srcThought->item; dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; }