mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: return out early if we have no regions
This commit is contained in:
parent
eb6692ab9e
commit
bef18681cf
@ -222,9 +222,16 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
}
|
||||
}
|
||||
|
||||
if (regId == 0)
|
||||
{
|
||||
// No regions generated, but without an error.
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allocate and init layer regions.
|
||||
const int nregs = (int)regId;
|
||||
rdScopedDelete<rcLayerRegion> regs((rcLayerRegion*)rdAlloc(sizeof(rcLayerRegion)*nregs, RD_ALLOC_TEMP));
|
||||
|
||||
if (!regs)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'regs' (%d).", nregs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user