Recast: return out early if we have no spans

All code below this will fail anyways as they rely on span count which can be null.
This commit is contained in:
Kawe Mazidjatari 2024-11-06 14:28:49 +01:00
parent bef18681cf
commit 40cea14a49

View File

@ -405,6 +405,9 @@ bool rcBuildCompactHeightfield(rcContext* context, const int walkableHeight, con
const int ySize = heightfield.height;
const int spanCount = rcGetHeightFieldSpanCount(context, heightfield);
if (!spanCount)
return false;
// Fill in header.
compactHeightfield.width = xSize;
compactHeightfield.height = ySize;