Cleanup some warnings.
This commit is contained in:
@@ -354,7 +354,7 @@ public static partial class Detour
|
||||
if (header.version != DT_NAVMESH_VERSION)
|
||||
return DT_FAILURE | DT_WRONG_VERSION;
|
||||
|
||||
dtNavMeshParams navMeshParams = new dtNavMeshParams();
|
||||
dtNavMeshParams navMeshParams = new();
|
||||
dtVcopy(navMeshParams.orig, header.bmin);
|
||||
navMeshParams.tileWidth = header.bmax[0] - header.bmin[0];
|
||||
navMeshParams.tileHeight = header.bmax[2] - header.bmin[2];
|
||||
|
||||
@@ -133,7 +133,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
|
||||
bytes.AddRange(BitConverter.GetBytes(firstLink));
|
||||
for (int i = 0; i < DT_VERTS_PER_POLYGON; ++i)
|
||||
@@ -196,7 +196,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
|
||||
bytes.AddRange(BitConverter.GetBytes(vertBase));
|
||||
bytes.AddRange(BitConverter.GetBytes(triBase));
|
||||
@@ -232,7 +232,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
|
||||
bytes.AddRange(BitConverter.GetBytes(polyRef));
|
||||
bytes.AddRange(BitConverter.GetBytes(next));
|
||||
@@ -270,7 +270,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
for (int j = 0; j < bmin.Length; ++j)
|
||||
{
|
||||
bytes.AddRange(BitConverter.GetBytes(bmin[j]));
|
||||
@@ -326,7 +326,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
for (int i = 0; i < 6; ++i)
|
||||
{
|
||||
bytes.AddRange(BitConverter.GetBytes(pos[i]));
|
||||
@@ -412,7 +412,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
|
||||
bytes.AddRange(BitConverter.GetBytes(magic));
|
||||
bytes.AddRange(BitConverter.GetBytes(version));
|
||||
@@ -537,7 +537,7 @@ public static partial class Detour
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
List<byte> bytes = new List<byte>();
|
||||
List<byte> bytes = new();
|
||||
|
||||
bytes.AddRange(header.ToBytes());
|
||||
for (int i = 0; i < polys.Length; ++i)
|
||||
@@ -645,7 +645,7 @@ public static partial class Detour
|
||||
///
|
||||
public dtNavMeshParams Clone()
|
||||
{
|
||||
dtNavMeshParams copy = new dtNavMeshParams();
|
||||
dtNavMeshParams copy = new();
|
||||
for (int i = 0; i < orig.Length; ++i)
|
||||
{
|
||||
copy.orig[i] = orig[i];
|
||||
|
||||
@@ -222,7 +222,7 @@ public static partial class Detour
|
||||
raycastLimitSqr = 0f;
|
||||
}
|
||||
}
|
||||
private dtQueryData m_query = new dtQueryData(); //< Sliced query state.
|
||||
private dtQueryData m_query = new(); //< Sliced query state.
|
||||
|
||||
private dtNodePool m_tinyNodePool; //< Pointer to small node pool.
|
||||
private dtNodePool m_nodePool; //< Pointer to node pool.
|
||||
@@ -884,7 +884,7 @@ public static partial class Detour
|
||||
|
||||
nearestRef = 0;
|
||||
|
||||
dtFindNearestPolyQuery query = new dtFindNearestPolyQuery(this, center);
|
||||
dtFindNearestPolyQuery query = new(this, center);
|
||||
|
||||
dtStatus status = queryPolygons(center, halfExtents, filter, query);
|
||||
if (dtStatusFailed(status))
|
||||
@@ -1430,7 +1430,7 @@ public static partial class Detour
|
||||
return DT_FAILURE;
|
||||
}
|
||||
|
||||
dtRaycastHit rayHit = new dtRaycastHit();
|
||||
dtRaycastHit rayHit = new();
|
||||
rayHit.maxPath = 0;
|
||||
|
||||
int iter = 0;
|
||||
@@ -2579,7 +2579,7 @@ public static partial class Detour
|
||||
public dtStatus raycast(dtPolyRef startRef, float[] startPos, float[] endPos, dtQueryFilter filter, ref float t, float[] hitNormal, dtPolyRef[] path, ref uint pathCount, int maxPath)
|
||||
{
|
||||
|
||||
dtRaycastHit hit = new dtRaycastHit();
|
||||
dtRaycastHit hit = new();
|
||||
hit.path = path;
|
||||
hit.maxPath = maxPath;
|
||||
|
||||
@@ -2670,16 +2670,16 @@ public static partial class Detour
|
||||
|
||||
dtStatus status = DT_SUCCESS;
|
||||
|
||||
dtMeshTile prevTile = new dtMeshTile();
|
||||
dtMeshTile prevTile = new();
|
||||
dtMeshTile nextTile;
|
||||
dtPoly prevPoly = new dtPoly();
|
||||
dtPoly prevPoly = new();
|
||||
dtPoly nextPoly;
|
||||
dtPolyRef curRef;
|
||||
|
||||
// The API input has been checked already, skip checking internal data.
|
||||
curRef = startRef;
|
||||
dtMeshTile tile = new dtMeshTile();
|
||||
dtPoly poly = new dtPoly();
|
||||
dtMeshTile tile = new();
|
||||
dtPoly poly = new();
|
||||
m_nav.getTileAndPolyByRefUnsafe(curRef, ref tile, ref poly);
|
||||
nextTile = prevTile = tile;
|
||||
nextPoly = prevPoly = poly;
|
||||
|
||||
Reference in New Issue
Block a user