feat(adt): preserve MODF nameSet + scale fields across load/save round-trip

WMOPlacement struct gains nameSet and scale fields (defaulting to 0 and
1024 = 1.0). The loader now reads them when the entry is the full 64
bytes (WotLK+); the writer emits the actual values rather than always
hard-coding (0, 1024). Older expansions still round-trip cleanly because
defaults match the previous behaviour.
This commit is contained in:
Kelsi 2026-05-06 03:37:13 -07:00
parent 446b0970dc
commit db1968f2cc
3 changed files with 13 additions and 5 deletions

View file

@ -248,6 +248,13 @@ void ADTLoader::parseMODF(const uint8_t* data, size_t size, ADTTerrain& terrain)
placement.extentUpper[2] = readFloat(data, offset + 52);
placement.flags = readUInt16(data, offset + 56);
placement.doodadSet = readUInt16(data, offset + 58);
// WotLK MODF entries include trailing nameSet + scale (4 bytes); older
// expansions left them as padding.
if (offset + 64 <= size) {
placement.nameSet = readUInt16(data, offset + 60);
placement.scale = readUInt16(data, offset + 62);
if (placement.scale == 0) placement.scale = 1024;
}
terrain.wmoPlacements.push_back(placement);
}