shithub: dumb

Download patch

ref: 3a3375f808ee166c78315e1005cd82203e356b3c
parent: f8dfb33eeaf570b29580736dd1d5092e49ae9ddf
author: Chris Moeller <[email protected]>
date: Fri Sep 27 15:51:13 EDT 2013

Fixed IT envelope loop pickup when the loop start is not on the first tick

--- a/dumb/src/it/itrender.c
+++ b/dumb/src/it/itrender.c
@@ -3838,7 +3838,7 @@
 
 	if ((envelope->flags & IT_ENVELOPE_SUSTAIN_LOOP) && !(playing->flags & IT_PLAYING_SUSTAINOFF)) {
 		if (pe->tick > envelope->node_t[envelope->sus_loop_end]) {
-			pe->next_node = envelope->sus_loop_start;
+			pe->next_node = envelope->sus_loop_start + 1;
 			ASSERT(pe->next_node < envelope->n_nodes);
 			pe->tick = envelope->node_t[envelope->sus_loop_start];
 			return 0;
@@ -3845,7 +3845,7 @@
 		}
 	} else if (envelope->flags & IT_ENVELOPE_LOOP_ON) {
 		if (pe->tick > envelope->node_t[envelope->loop_end]) {
-			pe->next_node = envelope->loop_start;
+			pe->next_node = envelope->loop_start + 1;
 			ASSERT(pe->next_node < envelope->n_nodes);
 			pe->tick = envelope->node_t[envelope->loop_start];
 			return 0;