diff --git a/tools/editor/adt_writer.cpp b/tools/editor/adt_writer.cpp index f43a40e5..1630341d 100644 --- a/tools/editor/adt_writer.cpp +++ b/tools/editor/adt_writer.cpp @@ -154,6 +154,11 @@ void ADTWriter::writeMODF(std::vector& 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); }