Skip to content

Commit 9206595

Browse files
committed
fix: use lag compensation in piano shortcut, auto-save & backup timer
1 parent 82214a0 commit 9206595

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/control_draw/control_draw.gml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ function control_draw() {
4545
if refreshrate = 2 game_set_speed(120,gamespeed_fps)
4646
if refreshrate = 3 game_set_speed(144,gamespeed_fps)
4747
if refreshrate = 4 game_set_speed(240,gamespeed_fps)
48-
editline += 30 / (room_speed)
48+
editline += 30 / (room_speed) * (1 / currspeed)
4949
if (editline > 60) editline = 0
5050
if (delay > 0) delay -= 1 / (room_speed / 20)
5151
if (delay < 0) delay = 0
5252
if (!isplayer) {
53-
work_mins += 1 / (room_speed * 60)
53+
work_mins += 1 / (room_speed * 60) * (1 / currspeed)
5454
}
5555

5656
file_dnd_set_files("*.nbs;*.mid;*.midi;*.nbp", 1, 0, 0)
@@ -95,7 +95,7 @@ function control_draw() {
9595
if (!isplayer) {
9696
// Autosave
9797
if (autosave && filename_ext(filename) = ".nbs") {
98-
tonextsave -= 1 / room_speed / 60
98+
tonextsave -= 1 / room_speed / 60 * (1 / currspeed)
9999
if (tonextsave <= 0 && playing == 0) {
100100
tonextsave = autosavemins
101101
save_song(filename, true)
@@ -104,7 +104,7 @@ function control_draw() {
104104

105105
// Auto-recovery
106106
if (totalblocks > 0) {
107-
tonextbackup -= 1 / room_speed / 60
107+
tonextbackup -= 1 / room_speed / 60 * (1 / currspeed)
108108
if (tonextbackup <= 0 && playing == 0) {
109109
if (filename_name(filename) != "") {
110110
song_backupname = filename_name(filename)

0 commit comments

Comments
 (0)