mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: fix poly detail height bug when height isn't found
The height couldn't be found on some edge case scenarios (typically complex geometry), but in these cases the height was still set to (unsigned short)-1, causing it to return a height very far into positive Z. The vert would therefore appears very far into the sky. This patch fixes this problem.
This commit is contained in:
parent
f95eb13ab3
commit
88052ba558
@ -278,6 +278,11 @@ static unsigned short getHeight(const float fx, const float fy, const float fz,
|
||||
y += dy;
|
||||
}
|
||||
}
|
||||
|
||||
// No height found, return a reasonable fall back height.
|
||||
if (h == RC_UNSET_HEIGHT)
|
||||
h = (unsigned short)floorf(fz/ch);
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user