mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
fix(adt): MODF entry was 60 bytes but parser expects 64 — write nameSet+scale tail
Each MODF entry in ADT files is 64 bytes (per MODF spec). The writer was emitting only 60 bytes, missing the trailing nameSet(u16) + scale(u16). The loader uses entrySize=64 to advance per record, so any saved ADT with more than one WMO placement misaligned every subsequent record on reload. Now pads with nameSet=0 and scale=1024 (=1.0 fixed-point).
This commit is contained in:
parent
804c7d3d60
commit
bbdd48a78a
1 changed files with 5 additions and 0 deletions
|
|
@ -154,6 +154,11 @@ 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);
|
||||
}
|
||||
patchSize(buf, start);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue