feat(editor): preserve WMO instance scale across ADT load/save

The MODF scale field (u16 / 1024 = float) is now propagated in both
directions: load reads wp.scale -> obj.scale, syncToTerrain converts
obj.scale * 1024 -> wp.scale (clamped to u16). Combined with the prior
loader/writer changes this means non-1.0 WMO scales (used by some
WotLK content) survive a save/reload cycle.
This commit is contained in:
Kelsi 2026-05-06 03:40:03 -07:00
parent db1968f2cc
commit f856a90281
2 changed files with 7 additions and 1 deletions

View file

@ -388,6 +388,10 @@ void ObjectPlacer::syncToTerrain() {
wp.rotation[2] = -obj.rotation.x;
wp.flags = 0;
wp.doodadSet = 0;
wp.nameSet = 0;
// MODF scale is fixed-point u16 (1024 = 1.0); cap to u16 max.
float s1024 = obj.scale * 1024.0f;
wp.scale = static_cast<uint16_t>(std::clamp(s1024, 0.0f, 65535.0f));
terrain_->wmoPlacements.push_back(wp);
}
}