Skip to content

Commit 1ba8477

Browse files
committed
upper bound for tempo changer and sound stopper
1 parent 00dfe4f commit 1ba8477

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/draw_window_edit_sound_stopper/draw_window_edit_sound_stopper.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function draw_window_edit_sound_stopper() {
4141
try {
4242
temp_start = int64(sound_stopper_set_start)
4343
temp_until = int64(sound_stopper_set_until)
44-
if (temp_start >= 0 && temp_until >= 0) {
44+
if (temp_start >= 0 && temp_until >= 0 && temp_start < 32768 && temp_until < 32768) {
4545
songs[song].song_pit[@ tempo_changer_sel_x, tempo_changer_sel_y] = temp_start
4646
var temp_arr = short_to_panning_velocity(temp_until)
4747
songs[song].song_pan[@ tempo_changer_sel_x, tempo_changer_sel_y] = temp_arr[0]

scripts/draw_window_edit_tempo_changer/draw_window_edit_tempo_changer.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function draw_window_edit_tempo_changer() {
3636
if (draw_button2(x1 + 10, y1 + 98, 60, condstr(language != 1, "OK", "确定"))) {
3737
try {
3838
temp_tempo = int64(tempo_changer_set_tempo)
39-
if (temp_tempo > 0) {
39+
if (temp_tempo > 0 && temp_tempo < 32768) {
4040
songs[song].song_pit[@ tempo_changer_sel_x, tempo_changer_sel_y] = temp_tempo
4141
history_set(h_changeblock, tempo_changer_sel_x, tempo_changer_sel_y, tempo_changer_sel_ins, songs[song].song_key[tempo_changer_sel_x, tempo_changer_sel_y], songs[song].song_vel[tempo_changer_sel_x, tempo_changer_sel_y], songs[song].song_pan[tempo_changer_sel_x, tempo_changer_sel_y], temp_tempo, pins, pkey, pvel, ppan, ppit)
4242
tempo_changer_sel_x = -1

0 commit comments

Comments
 (0)