Recast: fix navmesh corruption when writing for MSET 5

MSET 5 must have this data before the traverse tables, this was forgotten during the refactor.
This commit is contained in:
Kawe Mazidjatari 2024-08-11 23:14:08 +02:00
parent ba43a1ab72
commit a3fd5ba2f9

View File

@ -1069,6 +1069,12 @@ void Editor::saveAll(std::string path, const dtNavMesh* mesh)
fwrite(tile->data, tile->dataSize, 1, fp);
}
#if DT_NAVMESH_SET_VERSION == 5
int mset5Unkown = 0;
for (int i = 0; i < params->polyGroupCount; i++)
fwrite(&mset5Unkown, sizeof(int), 1, fp);
#endif
// Only store if we have 3 or more poly groups.
if (params->polyGroupCount >= DT_MIN_POLY_GROUP_COUNT)
{