X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftape.c;h=cd07263f007f2e4842c1395e13a5c17f6d6adecf;hp=fb00fcd561e7fdc220ff2ac5b14422dcaf3f707d;hb=HEAD;hpb=81cbb1611f72a0b338aac54f43e020555f5a28f0 diff --git a/src/tape.c b/src/tape.c index fb00fcd5..f16e7ec9 100644 --- a/src/tape.c +++ b/src/tape.c @@ -779,7 +779,9 @@ static void TapeAppendRecording(void) void TapeHaltRecording(void) { - tape.counter++; + // only advance tape counter if any input events have been recorded + if (tape.pos[tape.counter].delay > 0) + tape.counter++; // initialize delay for next tape entry (to be able to continue recording) if (tape.counter < MAX_TAPE_LEN) @@ -934,6 +936,10 @@ void TapeTogglePause(boolean toggle_mode) ModifyPauseButtons(); } + + // stop tape when leaving auto-pause after completely replaying tape + if (tape.playing && !tape.pausing && tape.counter >= tape.length) + TapeStop(); } void TapeStartPlaying(void)