mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-10-30 04:25:56 +00:00
When attempting to add a span that is invalid (zero or negative size), log a warning and ignore the span.
This commit is contained in:
@@ -195,6 +195,13 @@ bool rcAddSpan(rcContext* context, rcHeightfield& heightfield,
|
||||
{
|
||||
rcAssert(context);
|
||||
|
||||
// Span is zero size or inverted size. Ignore.
|
||||
if (spanMin >= spanMax)
|
||||
{
|
||||
context->log(RC_LOG_WARNING, "rcAddSpan: Adding a span with zero or negative size. Ignored.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!addSpan(heightfield, x, z, spanMin, spanMax, areaID, flagMergeThreshold))
|
||||
{
|
||||
context->log(RC_LOG_ERROR, "rcAddSpan: Out of memory.");
|
||||
|
||||
Reference in New Issue
Block a user