fix(terrain): main game also propagates MODF scale to WMO instances

Mirrors the editor's WMO scale fix. WMOReady gains a scale field that
is computed from the loaded MODF placement.scale (u16 / 1024) and
forwarded to wmoRenderer->createInstance(). Without this the main
game ignored MODF scale even on WotLK ADTs that use it.
This commit is contained in:
Kelsi 2026-05-06 03:55:14 -07:00
parent cbf1d4638f
commit 1d05bb0f13
2 changed files with 5 additions and 1 deletions

View file

@ -99,6 +99,7 @@ struct PendingTile {
pipeline::WMOModel model;
glm::vec3 position;
glm::vec3 rotation;
float scale = 1.0f;
};
std::vector<WMOReady> wmoModels;

View file

@ -860,6 +860,8 @@ std::shared_ptr<PendingTile> TerrainManager::prepareTile(int x, int y) {
ready.model = std::move(wmoModel);
ready.position = pos;
ready.rotation = rot;
ready.scale = placement.scale > 0
? static_cast<float>(placement.scale) / 1024.0f : 1.0f;
pending->wmoModels.push_back(std::move(ready));
}
}
@ -1103,7 +1105,8 @@ bool TerrainManager::advanceFinalization(FinalizingTile& ft) {
}
// Create the instance on first visit (liquidGroupIndex == 0)
if (ft.wmoLiquidGroupIndex == 0) {
uint32_t wmoInstId = wmoRenderer->createInstance(wmoReady.modelId, wmoReady.position, wmoReady.rotation);
uint32_t wmoInstId = wmoRenderer->createInstance(
wmoReady.modelId, wmoReady.position, wmoReady.rotation, wmoReady.scale);
if (!wmoInstId) {
ft.wmoInstanceIndex++;
continue;