diff --git a/src/DotRecast.Detour/Io/DtMeshSetReader.cs b/src/DotRecast.Detour/Io/DtMeshSetReader.cs index 26b384e..a02e020 100644 --- a/src/DotRecast.Detour/Io/DtMeshSetReader.cs +++ b/src/DotRecast.Detour/Io/DtMeshSetReader.cs @@ -67,7 +67,7 @@ namespace DotRecast.Detour.Io bool cCompatibility = header.version == NavMeshSetHeader.NAVMESHSET_VERSION; DtNavMesh mesh = new DtNavMesh(header.option, header.maxVertsPerPoly); - ReadTiles(bb, is32Bit, header, cCompatibility, mesh); + ReadTiles(bb, is32Bit, ref header, cCompatibility, mesh); return mesh; } @@ -104,7 +104,7 @@ namespace DotRecast.Detour.Io return header; } - private void ReadTiles(RcByteBuffer bb, bool is32Bit, NavMeshSetHeader header, bool cCompatibility, DtNavMesh mesh) + private void ReadTiles(RcByteBuffer bb, bool is32Bit, ref NavMeshSetHeader header, bool cCompatibility, DtNavMesh mesh) { // Read tiles. for (int i = 0; i < header.numTiles; ++i) diff --git a/src/DotRecast.Detour/Io/NavMeshSetHeader.cs b/src/DotRecast.Detour/Io/NavMeshSetHeader.cs index 11ba57c..2d7ab1c 100644 --- a/src/DotRecast.Detour/Io/NavMeshSetHeader.cs +++ b/src/DotRecast.Detour/Io/NavMeshSetHeader.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: namespace DotRecast.Detour.Io { - public class NavMeshSetHeader + public struct NavMeshSetHeader { public const int NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // 'MSET'; public const int NAVMESHSET_VERSION = 1; @@ -28,7 +28,7 @@ namespace DotRecast.Detour.Io public int magic; public int version; public int numTiles; - public DtNavMeshParams option = new DtNavMeshParams(); + public DtNavMeshParams option; public int maxVertsPerPoly; } } \ No newline at end of file