1
0
mirror of https://github.com/Mauler125/r5sdk.git synced 2025-02-09 19:15:03 +01:00

Write each field individually

Cluster links were written with an additional padding as the struct is 11 in size, so it gets padded to 12. Cluster links now get correctly written to the disk.
This commit is contained in:
Amos 2023-08-25 08:47:12 +02:00
parent 52bc73abb0
commit 5ddc9d1884

@ -313,7 +313,15 @@ void CAI_NetworkBuilder::SaveNetworkGraph(CAI_Network* pNetwork)
// Disk and memory structs are literally identical here so just directly write.
const CAI_ClusterLink* clusterLink = (*g_pAIClusterLinks)[i];
FileSystem()->Write(clusterLink, sizeof(CAI_ClusterLink), pAIGraph);
FileSystem()->Write(&clusterLink->prevIndex_MAYBE, sizeof(short), pAIGraph);
FileSystem()->Write(&clusterLink->nextIndex_MAYBE, sizeof(short), pAIGraph);
FileSystem()->Write(&clusterLink->unk2, sizeof(int), pAIGraph);
FileSystem()->Write(&clusterLink->flags, sizeof(char), pAIGraph);
FileSystem()->Write(&clusterLink->unk4, sizeof(char), pAIGraph);
FileSystem()->Write(&clusterLink->unk5, sizeof(char), pAIGraph);
}
timer.End();