diff --git a/src/engine/cmdStreamOps.cpp b/src/engine/cmdStreamOps.cpp index 1d8b24fb8..7d50c7a60 100644 --- a/src/engine/cmdStreamOps.cpp +++ b/src/engine/cmdStreamOps.cpp @@ -293,12 +293,13 @@ SafeWriter* DivEngine::saveCommand(bool binary) { int lastTick[DIV_MAX_CHANS]; memset(lastTick,0,DIV_MAX_CHANS*sizeof(int)); + bool wroteTickGlobal=false; while (!done) { if (nextTick(false,true) || !playing) { done=true; } // get command stream - bool wroteTickGlobal=false; + wroteTickGlobal=false; memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool)); if (curDivider!=divider) { curDivider=divider; @@ -339,6 +340,11 @@ SafeWriter* DivEngine::saveCommand(bool binary) { cmdStream.clear(); tick++; } + wroteTickGlobal=false; + memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool)); + for (int i=0; i