From b6d889359f84da091a6e1764dc812939f130205f Mon Sep 17 00:00:00 2001 From: Nikola Fox Date: Wed, 16 Jun 2021 20:44:44 +0200 Subject: [PATCH] fix bug with mods which have used empty samples --- src/converter.js | 11 +++++------ static/index.html | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/converter.js b/src/converter.js index cf0a377..f949151 100644 --- a/src/converter.js +++ b/src/converter.js @@ -144,18 +144,17 @@ class Converter { var removedSamples = 0; var sampleBytesSaved = 0; - var instrumentMap = []; var currentInstrument = 1; for (var i = 0; i < mod.instruments.length; i++) { - if (mod.instruments[i].length > 0) { - if (!usedInstruments.has(mod.instruments[i].number)) { + if (!usedInstruments.has(mod.instruments[i].number)) { + if (mod.instruments[i].length > 0) { sampleBytesSaved += mod.killInstrument(mod.instruments[i].number); removedSamples++; - } else { - instrumentMap[i + 1] = currentInstrument++; - } + } + } else { + instrumentMap[i + 1] = currentInstrument++; } } diff --git a/static/index.html b/static/index.html index 1ac7ce8..a393a81 100644 --- a/static/index.html +++ b/static/index.html @@ -17,7 +17,7 @@ / /_/ _/ / / /_/ / / \_/ \______/\_/\_/ \____/ - -= RETROCONVERTER v1.0.0 =- + -= RETROCONVERT v1.0.1 =- © 2020-2021 JUiCE / iNSANE ^ Reality