Skip to content

Commit

Permalink
Fix ArrayIndexOutOfBoundsException #192
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Oct 14, 2024
1 parent 2c6a6bf commit 587fc0c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ private static ReallocationData manualMapping(
Arrays.parallelPrefix(brushSideIndices, Integer::sum);

var scores = createScores(bsp, windingFactory, occluderPolyIndices, brushSideIndices, firstNonWorldIBrush);
var mappingResult = hungarian((j, w) -> scores[j][w], scores.length, scores[0].length);
var mappingResult = hungarian(
(j, w) -> scores[j][w],
occluderPolyIndices.length > 0 ? occluderPolyIndices[occluderPolyIndices.length - 1] : 0,
brushSideIndices.length > 0 ? brushSideIndices[brushSideIndices.length - 1] : 0
);
var collectBrushes = collectBrushes(bsp, mappingResult, scores, occluderPolyIndices, brushSideIndices,
firstNonWorldIBrush);

Expand Down

0 comments on commit 587fc0c

Please sign in to comment.