mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
Ignore polygons with fewer than three sides
This commit is contained in:
parent
9ebfa7b795
commit
0bd8b09ecf
1 changed files with 5 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue