From 0bd8b09ecff9f00873fc13dcd2a5662bf3efff61 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Wed, 29 Apr 2020 14:12:07 -0700 Subject: [PATCH] Ignore polygons with fewer than three sides --- js/regionParser.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/regionParser.ts b/js/regionParser.ts index 14e571c4..1825fb03 100644 --- a/js/regionParser.ts +++ b/js/regionParser.ts @@ -26,6 +26,11 @@ export default function regionParser(regionStr: string): RegionData { let pointIndex = 0; const polygons = pointCounts.map((numStr) => { const num = Number(numStr); + if (num < 3) { + // What use is a polygon with less than three sides? + pointIndex += num; + return null; + } const polygon = points.slice(pointIndex, pointIndex + num).join(" "); if (!polygon.length) { // It's possible that the skin author specified more polygons than provided points.