SquarerFive / cesium-procedural-foliage

Apache License 2.0
39 stars 14 forks source link

Small comparison bug #3

Closed kebiro closed 2 years ago

kebiro commented 2 years ago

Just noticed there might be a little bug in FoliageCaptureActor.cpp.

In the lambda function that is bound to OnRenderTargetRead there is this little for loop:

UFoliageHISM* MinimumHISM = HISMFoliageMap[FoliageGeometryType][0];
for (UFoliageHISM* HISM : HISMFoliageMap[FoliageGeometryType])
{
    if (FoliageTransforms.HISMTransformMap.Contains(HISM) && FoliageTransforms.HISMTransformMap.Contains(MinimumHISM))
    {
        if (FoliageTransforms.HISMTransformMap[HISM].Num() < FoliageTransforms.HISMTransformMap[HISM].Num())
        {
            MinimumHISM = HISM;
        }
    }
}

Looks to me like that if condition should use MinimumHISM as the index to the right of the comparison operator.

SquarerFive commented 2 years ago

Good find! I'll include a fix in the next push