Skip to content

Commit 20caa0c

Browse files
committed
check ins nums before write
1 parent 9c1da1a commit 20caa0c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/save_song/save_song.gml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ function save_song() {
7878
buffer_write_byte(cursong.loopmax)
7979
buffer_write_short(cursong.loopstart)
8080
}
81+
82+
if (nbsver < 6) {
83+
for (var ind = 16; ind < 20; ind++) {
84+
if(songs[song].instrument_list[| ind].num_blocks > 0) has_v6_ins = true
85+
}
86+
}
8187

8288
ca = 0
8389
var ins = 0
@@ -93,7 +99,6 @@ function save_song() {
9399
buffer_write_short(cb)
94100
cb = 0
95101
ins = ds_list_find_index(cursong.instrument_list, cursong.song_ins[a, b])
96-
if (nbsver < 6 && ins > 15 && ins < 20) has_v6_ins = true
97102
if (nbsver < 6 && ins >= 20 && !has_v6_ins) ins -= 4
98103
buffer_write_byte(ins)
99104
buffer_write_byte(cursong.song_key[a, b])

0 commit comments

Comments
 (0)