mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 14:00:39 +00:00
Merge pull request #1772 from pacomont/Fix_crash_when_saving_NavMesh_file_without_Links
Fix crash when saving NavMesh file without Links
This commit is contained in:
commit
e7972bd6a9
1 changed files with 9 additions and 6 deletions
|
|
@ -1670,12 +1670,15 @@ bool NavMesh::save()
|
|||
|
||||
S32 s = mLinkIDs.size();
|
||||
file.write(sizeof(S32), (const char*)&s);
|
||||
file.write(sizeof(F32) * s * 6, (const char*)mLinkVerts.address());
|
||||
file.write(sizeof(F32) * s, (const char*)mLinkRads.address());
|
||||
file.write(sizeof(U8) * s, (const char*)mLinkDirs.address());
|
||||
file.write(sizeof(U8) * s, (const char*)mLinkAreas.address());
|
||||
file.write(sizeof(U16) * s, (const char*)mLinkFlags.address());
|
||||
file.write(sizeof(U32) * s, (const char*)mLinkIDs.address());
|
||||
if (s > 0)
|
||||
{
|
||||
file.write(sizeof(F32) * s * 6, (const char*)mLinkVerts.address());
|
||||
file.write(sizeof(F32) * s, (const char*)mLinkRads.address());
|
||||
file.write(sizeof(U8) * s, (const char*)mLinkDirs.address());
|
||||
file.write(sizeof(U8) * s, (const char*)mLinkAreas.address());
|
||||
file.write(sizeof(U16) * s, (const char*)mLinkFlags.address());
|
||||
file.write(sizeof(U32) * s, (const char*)mLinkIDs.address());
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue