Skip to content

Commit 0a966f6

Browse files
committed
Value looper only records on tick
1 parent 45c1d4a commit 0a966f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

utils/src/looper.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,12 @@ where
283283
let stored = self.sequence.current_mut();
284284
let out = match (recording, stored.clone()) {
285285
(true, _) | (_, None) => {
286-
*stored = Some(sample.clone());
287-
changed_this_frame = true;
286+
// Even if we're not recording, still record if there is no current stored
287+
// value just so we have something to return.
288+
if tick {
289+
*stored = Some(sample.clone());
290+
changed_this_frame = true;
291+
}
288292
sample
289293
}
290294
(_, Some(stored)) => stored,

0 commit comments

Comments
 (0)