mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: fix:rcBuildLayerRegions missing areaType
Merge recastnavitagion/recastnavitagion@ddaa361b08
This commit is contained in:
parent
714674ae33
commit
e3bf2036b3
@ -1073,11 +1073,13 @@ static bool mergeAndFilterLayerRegions(rcContext* ctx, int minRegionArea,
|
||||
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
|
||||
{
|
||||
const rcCompactSpan& s = chf.spans[i];
|
||||
const unsigned char area = chf.areas[i];
|
||||
const unsigned short ri = srcReg[i];
|
||||
if (ri == 0 || ri >= nreg) continue;
|
||||
rcRegion& reg = regions[ri];
|
||||
|
||||
reg.spanCount++;
|
||||
reg.areaType = area;
|
||||
|
||||
reg.zmin = rcMin(reg.zmin, s.z);
|
||||
reg.zmax = rcMax(reg.zmax, s.z);
|
||||
@ -1158,6 +1160,9 @@ static bool mergeAndFilterLayerRegions(rcContext* ctx, int minRegionArea,
|
||||
// Skip already visited.
|
||||
if (regn.id != 0)
|
||||
continue;
|
||||
// Skip if different area type, do not connect regions with different area type.
|
||||
if (reg.areaType != regn.areaType)
|
||||
continue;
|
||||
// Skip if the neighbour is overlapping root region.
|
||||
bool overlap = false;
|
||||
for (int k = 0; k < root.floors.size(); k++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user