From c478d07b981eea98acc897d5eff2003f61138272 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 11 May 2026 22:18:07 -0600 Subject: Fixed samples being duplicated among other assets probably --- src/Companion.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Companion.cpp') diff --git a/src/Companion.cpp b/src/Companion.cpp index 743368f..93aefbc 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -666,6 +666,11 @@ void Companion::ProcessFile(YAML::Node root) { void Companion::ProcessFile(YAML::Node root, std::atomic& assetCount) { assetCount++; + // Reset per-file state so segment/offset settings from a previous file don't + // bleed into this file's Phase 1 gAddrMap registration. + gCurrentSegmentNumber = 0; + gCurrentFileOffset = 0; + gCurrentCompressionType = CompressionType::None; // Set compressed file offsets and compression type if (auto segments = root[":config"]["segments"]) { if (segments.IsSequence() && segments.size() > 0) { @@ -711,7 +716,8 @@ void Companion::ProcessFile(YAML::Node root, std::atomic& assetCount) { node["path"] = gCurrentVirtualPath; } - this->gAddrMap[this->gCurrentFile][node["offset"].as()] = std::make_tuple(output, node); + auto off = node["offset"].as(); + this->gAddrMap[this->gCurrentFile][off] = std::make_tuple(output, node); } // Stupid hack because the iteration broke the assets -- cgit v1.2.3