diff --git a/skin.js b/skin.js index 21421d3d..87a5253e 100644 --- a/skin.js +++ b/skin.js @@ -75,11 +75,17 @@ SkinManager = { _parseVisColors: function(zip) { var entries = this._findFileInZip("VISCOLOR.TXT", zip).asText().split("\n"); - var regex = /^(\d+),\s*(\d+),\s*(\d+)/ - for(var i = 0; i <= entries.length; i++) { + var regex = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/ + // changed to a hard number to deal with empty lines at the end... + // plus its only meant to be an exact amount of numbers anywayz + // - @PAEz + for(var i = 0; i < 24; i++) { var matches = regex.exec(entries[i]); if(matches) { this.visColors.push('rgb(' + matches.slice(1,4).join(',') + ')'); + } else { + console.error('Error in VISCOLOR.TXT on line', i); + this.visColors.push('rgb(255,0,0)'); } } },