mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-15 04:38:21 +00:00
Fix if condition to actually return the value...
This commit is contained in:
parent
8da23df5d6
commit
7388d47b90
@ -143,11 +143,13 @@ float dNavMesh::GetHeightAtPoint(const NiPoint3& location, const float halfExten
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (toReturn == 0.0f) {
|
if (toReturn == 0.0f) {
|
||||||
toReturn = location.y;
|
|
||||||
// If we were unable to get the poly height, but the query returned a success, just use the height of the nearest point.
|
// If we were unable to get the poly height, but the query returned a success, just use the height of the nearest point.
|
||||||
// This is what seems to happen anyways and it is better than returning zero.
|
// This is what seems to happen anyways and it is better than returning zero.
|
||||||
} else if (hasPoly == DT_SUCCESS) {
|
if (hasPoly == DT_SUCCESS) {
|
||||||
toReturn = nearestPoint[1];
|
toReturn = nearestPoint[1];
|
||||||
|
} else {
|
||||||
|
toReturn = location.y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// If we failed to even find a poly, do not change the height since we have no idea what it should be.
|
// If we failed to even find a poly, do not change the height since we have no idea what it should be.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user