Remove dead assignments

Credit to @rafzi in PR #93
This commit is contained in:
Ben Hymers 2016-02-16 14:13:36 +00:00
parent c208fd332c
commit 8f16b7de2f
2 changed files with 7 additions and 6 deletions

View File

@ -106,7 +106,6 @@ inline int longestAxis(unsigned short x, unsigned short y, unsigned short z)
if (z > maxVal)
{
axis = 2;
maxVal = z;
}
return axis;
}

View File

@ -1849,10 +1849,12 @@ dtStatus dtNavMeshQuery::findStraightPath(const float* startPos, const float* en
for (int i = 0; i < pathSize; ++i)
{
float left[3], right[3];
unsigned char fromType, toType;
unsigned char toType;
if (i+1 < pathSize)
{
unsigned char fromType; // fromType is ignored.
// Next portal.
if (dtStatusFailed(getPortalPoints(path[i], path[i+1], left, right, fromType, toType)))
{
@ -1894,7 +1896,7 @@ dtStatus dtNavMeshQuery::findStraightPath(const float* startPos, const float* en
dtVcopy(left, closestEndPos);
dtVcopy(right, closestEndPos);
fromType = toType = DT_POLYTYPE_GROUND;
toType = DT_POLYTYPE_GROUND;
}
// Right vertex.
@ -2482,10 +2484,10 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons
const dtMeshTile* prevTile, *tile, *nextTile;
const dtPoly* prevPoly, *poly, *nextPoly;
dtPolyRef curRef, nextRef;
dtPolyRef curRef;
// The API input has been checked already, skip checking internal data.
nextRef = curRef = startRef;
curRef = startRef;
tile = 0;
poly = 0;
m_nav->getTileAndPolyByRefUnsafe(curRef, &tile, &poly);
@ -2540,7 +2542,7 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons
}
// Follow neighbours.
nextRef = 0;
dtPolyRef nextRef = 0;
for (unsigned int i = poly->firstLink; i != DT_NULL_LINK; i = tile->links[i].next)
{