From 4fd285b5c443f1692d56ef905442cb84450947bb Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 01:40:44 -0700 Subject: [PATCH] feat(editor): collectWMOTextures recurses into WMO doodad M2 textures WMO buildings reference M2 doodads (chairs, candles, banners) via the MODD chunk. Their textures live in those M2 files, not the WMO root. Now collectWMOTextures walks every doodad name and collects M2 textures recursively so exported buildings include all their interior decoration textures. --- tools/editor/texture_exporter.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/editor/texture_exporter.cpp b/tools/editor/texture_exporter.cpp index 45470241..e34bcf6b 100644 --- a/tools/editor/texture_exporter.cpp +++ b/tools/editor/texture_exporter.cpp @@ -73,6 +73,17 @@ std::vector TextureExporter::collectWMOTextures(pipeline::AssetMana [](unsigned char c) { return std::tolower(c); }); unique.insert(p); } + + // WMO doodads (props inside the building) are M2 models — their textures + // also need to ship with the zone or the building will render with missing + // chairs/decorations. + std::unordered_set seenDoodadM2; + for (const auto& [offset, name] : wmo.doodadNames) { + (void)offset; + if (name.empty() || !seenDoodadM2.insert(name).second) continue; + for (auto& t : collectM2Textures(am, name)) unique.insert(std::move(t)); + } + out.assign(unique.begin(), unique.end()); std::sort(out.begin(), out.end()); return out;