fix(wob): emit default doodadSet so WMO renderer draws WoB doodads

WMORenderer uses doodadSets[0] to select which slice of the doodads
array to render. Without a set entry the renderer skipped every doodad
even when toWMOModel populated them. Now emits a default set named
'Set_$DefaultGlobal' covering all doodads — matches Blizzard's default
set name and convention.
This commit is contained in:
Kelsi 2026-05-06 02:09:24 -07:00
parent f2bbc8d60f
commit 318f255918

View file

@ -276,6 +276,7 @@ bool WoweeBuildingLoader::toWMOModel(const WoweeBuilding& building, WMOModel& ou
// assign sequential offsets here since none of our paths share suffixes.
outModel.doodads.clear();
outModel.doodadNames.clear();
outModel.doodadSets.clear();
uint32_t doodadOffset = 0;
for (const auto& dp : building.doodads) {
// Convert WOM extension back to M2 for the runtime that may not have a
@ -303,6 +304,18 @@ bool WoweeBuildingLoader::toWMOModel(const WoweeBuilding& building, WMOModel& ou
doodadOffset += static_cast<uint32_t>(mp.size() + 1);
}
// Renderer uses doodadSets[0] to know which slice of doodads to render.
// Without it, even with doodads populated, nothing draws. Emit a default
// "Set_$DefaultGlobal" set covering every doodad.
if (!outModel.doodads.empty()) {
WMODoodadSet ds{};
std::strncpy(ds.name, "Set_$DefaultGlobal", sizeof(ds.name) - 1);
ds.startIndex = 0;
ds.count = static_cast<uint32_t>(outModel.doodads.size());
ds.padding = 0;
outModel.doodadSets.push_back(ds);
}
return true;
}