diff --git a/sc2/src/sc2code/comm.c b/sc2/src/sc2code/comm.c index 9c51fa099..30d52e80d 100644 --- a/sc2/src/sc2code/comm.c +++ b/sc2/src/sc2code/comm.c @@ -1705,7 +1705,7 @@ DoCommunication (PENCOUNTER_STATE pES) { temp = curr->tag.data; if (temp == NULL) - break; + continue; // fprintf (stderr, "%s\n", temp); while (wstrlen (temp) > (unsigned int) SUMMARY_CHARS && !(GLOBAL (CurrentActivity) & CHECK_ABORT)) diff --git a/sc2/src/sc2code/libs/sound/sound.c b/sc2/src/sc2code/libs/sound/sound.c index 52a8e2a6b..21ba1b540 100644 --- a/sc2/src/sc2code/libs/sound/sound.c +++ b/sc2/src/sc2code/libs/sound/sound.c @@ -146,14 +146,16 @@ destroy_soundchain (TFB_SoundChain *chain) TFB_SoundChain * get_previous_chain (TFB_SoundChain *first_chain, TFB_SoundChain *current_chain) { - TFB_SoundChain *prev_chain; + TFB_SoundChain *prev_chain, *last_valid = NULL; prev_chain = first_chain; if (prev_chain == current_chain) return (prev_chain); while (prev_chain->next) { - if (prev_chain->next == current_chain || !prev_chain->next->tag.data) - return (prev_chain); + if (prev_chain->tag.type) + last_valid = prev_chain; + if (prev_chain->next == current_chain) + return (last_valid); prev_chain = prev_chain->next; } return (first_chain);