Skip to content

Commit

Permalink
fix bug with mods which have used empty samples
Browse files Browse the repository at this point in the history
  • Loading branch information
juusu committed Jun 16, 2021
1 parent 6ce70d9 commit b6d8893
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}

Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/ /_/ _/ / / /_/ / /
\_/ \______/\_/\_/ \____/

-= RETROCONVERTER v1.0.0 =-
-= RETROCONVERT v1.0.1 =-
&copy; 2020-2021 JUiCE / iNSANE ^ Reality
</pre>
<div class="ui raised segments">
Expand Down

0 comments on commit b6d8893

Please sign in to comment.