From 7de06ce5e49696740cad8709a9357f0d5166316a Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya0@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:44:20 -0400 Subject: [PATCH 1/4] Initialize SkinAnimatedLimbData::totalVtxCount to 0 totalVtxCount had no default value, so limbs that don't go through ParseRawData (non-SkinType_Animated limbs) would export uninitialized data as skinVtxCnt into the OTR file. Co-Authored-By: Claude Sonnet 4.6 --- ZAPD/OtherStructs/SkinLimbStructs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZAPD/OtherStructs/SkinLimbStructs.h b/ZAPD/OtherStructs/SkinLimbStructs.h index 0bc35a25..7ac7f993 100644 --- a/ZAPD/OtherStructs/SkinLimbStructs.h +++ b/ZAPD/OtherStructs/SkinLimbStructs.h @@ -101,7 +101,7 @@ class SkinAnimatedLimbData : public ZResource size_t GetRawDataSize() const override; public: - uint16_t totalVtxCount; + uint16_t totalVtxCount = 0; uint16_t limbModifCount; // Length of limbModifications segptr_t limbModifications; // SkinLimbModif* segptr_t dlist; // Gfx* From 2658cb2d9376e4792d43da601f94135f39b85d71 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya0@users.noreply.github.com> Date: Thu, 26 Mar 2026 23:39:57 -0400 Subject: [PATCH 2/4] Initialize SkinAnimatedLimbData::dlist to SEGMENTED_NULL dlist is only set in ParseRawData, which is only called for SkinType_Animated limbs. For all other limb types it is uninitialized. OTRExporter unconditionally checks segmentStruct.dlist != SEGMENTED_NULL and passes it through GETSEGOFFSET into GetDeclaration. If the garbage value's offset happened to match a key in the declarations map, it would write that declaration's path as skinDList2 into the OTR file. Co-Authored-By: Claude Sonnet 4.6 --- ZAPD/OtherStructs/SkinLimbStructs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZAPD/OtherStructs/SkinLimbStructs.h b/ZAPD/OtherStructs/SkinLimbStructs.h index 7ac7f993..fd26f4d6 100644 --- a/ZAPD/OtherStructs/SkinLimbStructs.h +++ b/ZAPD/OtherStructs/SkinLimbStructs.h @@ -104,7 +104,7 @@ class SkinAnimatedLimbData : public ZResource uint16_t totalVtxCount = 0; uint16_t limbModifCount; // Length of limbModifications segptr_t limbModifications; // SkinLimbModif* - segptr_t dlist; // Gfx* + segptr_t dlist = SEGMENTED_NULL; // Gfx* std::vector limbModifications_arr; // ZDisplayList* unk_8_dlist = nullptr; From e375fa309fc2cc8dabc57323fee641d452680d27 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya0@users.noreply.github.com> Date: Sat, 28 Mar 2026 06:55:12 -0400 Subject: [PATCH 3/4] Initialize SetMesh::data to 0 Co-Authored-By: Claude Opus 4.6 --- ZAPD/ZRoom/Commands/SetMesh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZAPD/ZRoom/Commands/SetMesh.h b/ZAPD/ZRoom/Commands/SetMesh.h index c0f15da9..fdcb69af 100644 --- a/ZAPD/ZRoom/Commands/SetMesh.h +++ b/ZAPD/ZRoom/Commands/SetMesh.h @@ -141,7 +141,7 @@ class RoomShapeCullable : public PolygonTypeBase class SetMesh : public ZRoomCommand { public: - uint8_t data; + uint8_t data = 0; uint8_t meshHeaderType; std::shared_ptr polyType; From 65fd03a3962506f8859686e78877e9cb791146f4 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya0@users.noreply.github.com> Date: Sat, 28 Mar 2026 07:34:20 -0400 Subject: [PATCH 4/4] Initialize RoomShapeImageMultiBgEntry::unk_00 and id to 0 These fields are only assigned in ParseRawData when isSubStruct is false (multi-bg entries). For single-bg rooms (isSubStruct=true), they are left uninitialized but still written by the OTRExporter. Co-Authored-By: Claude Opus 4.6 --- ZAPD/ZRoom/Commands/SetMesh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZAPD/ZRoom/Commands/SetMesh.h b/ZAPD/ZRoom/Commands/SetMesh.h index fdcb69af..b2779ae5 100644 --- a/ZAPD/ZRoom/Commands/SetMesh.h +++ b/ZAPD/ZRoom/Commands/SetMesh.h @@ -44,8 +44,8 @@ class RoomShapeDListsEntry : public ZResource class RoomShapeImageMultiBgEntry : public ZResource { public: - uint16_t unk_00; - uint8_t id; + uint16_t unk_00 = 0; + uint8_t id = 0; segptr_t source; uint32_t unk_0C; uint32_t tlut;