S_UpdateSoundTest: Corrections

- Fix inverted skipnull condition for forward sequence traversal
- Remove comment stating we used a naive implementation. The author of this commit used a triple pointer in the last one, this is anything but naive
This commit is contained in:
toaster 2023-03-28 12:42:07 +01:00
parent 90d5cb3752
commit 4f4976024c

View file

@ -1479,8 +1479,6 @@ void S_UpdateSoundTestDef(boolean reverse, boolean skipnull)
{ {
musicdef_t *newdef; musicdef_t *newdef;
// Naive implementation for now.
newdef = NULL; newdef = NULL;
if (reverse == false) if (reverse == false)
@ -1490,7 +1488,7 @@ void S_UpdateSoundTestDef(boolean reverse, boolean skipnull)
: soundtest.sequence.next; : soundtest.sequence.next;
while (newdef != NULL && S_SoundTestDefLocked(newdef)) while (newdef != NULL && S_SoundTestDefLocked(newdef))
newdef = newdef->sequence.next; newdef = newdef->sequence.next;
if (newdef == NULL && skipnull == false) if (newdef == NULL && skipnull == true)
{ {
newdef = soundtest.sequence.next; newdef = soundtest.sequence.next;
while (newdef != NULL && S_SoundTestDefLocked(newdef)) while (newdef != NULL && S_SoundTestDefLocked(newdef))