mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 09:33:51 +00:00
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:
parent
446b0970dc
commit
db1968f2cc
3 changed files with 13 additions and 5 deletions
|
|
@ -154,11 +154,10 @@ void ADTWriter::writeMODF(std::vector<uint8_t>& buf, const pipeline::ADTTerrain&
|
|||
writeFloat(buf, p.extentUpper[2]);
|
||||
writeU16(buf, p.flags);
|
||||
writeU16(buf, p.doodadSet);
|
||||
// MODF entry is 64 bytes total; we wrote 60, pad with nameSet(0) + scale(1024).
|
||||
// Loader treats entrySize as 64, so missing trailing bytes mis-align the
|
||||
// next entry. scale=1024 = 1.0 in MODF's fixed-point u16 encoding.
|
||||
writeU16(buf, 0);
|
||||
writeU16(buf, 1024);
|
||||
// MODF entry is 64 bytes total; the trailing nameSet + scale slots are
|
||||
// populated when present (WotLK+) and default to (0, 1024) otherwise.
|
||||
writeU16(buf, p.nameSet);
|
||||
writeU16(buf, p.scale != 0 ? p.scale : 1024);
|
||||
}
|
||||
patchSize(buf, start);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue