From c4f95ec7e2dda0a1ba4f55bc88ba4736ea3b5bc4 Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Sun, 3 Jul 2011 11:49:16 +0000 Subject: [PATCH] Fix for issue 174. --- Recast/Source/RecastFilter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Recast/Source/RecastFilter.cpp b/Recast/Source/RecastFilter.cpp index d01808a..66af37a 100644 --- a/Recast/Source/RecastFilter.cpp +++ b/Recast/Source/RecastFilter.cpp @@ -38,6 +38,7 @@ void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb { rcSpan* ps = 0; bool previousWalkable = false; + unsigned char previousArea = RC_NULL_AREA; for (rcSpan* s = solid.spans[x + y*w]; s; ps = s, s = s->next) { @@ -47,11 +48,12 @@ void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb if (!walkable && previousWalkable) { if (rcAbs((int)s->smax - (int)ps->smax) <= walkableClimb) - s->area = RC_NULL_AREA; + s->area = previousArea; } // Copy walkable flag so that it cannot propagate // past multiple non-walkable objects. previousWalkable = walkable; + previousArea = s->area; } } }