]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_mix.c
restructured parts of explosion code
[xonotic/darkplaces.git] / snd_mix.c
index f6cd8e889aec496fe909e440e0479da639978379..29e319f890d56932444e5c06cb44c7d054889df2 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -296,6 +296,17 @@ void S_PaintChannels(int endtime)
                        if (!S_LoadSound (sfx, true))
                                continue;
 
+                       // if the channel is paused
+                       if (ch->flags & CHANNELFLAG_PAUSED)
+                       {
+                               size_t pausedtime;
+
+                               pausedtime = end - paintedtime;
+                               ch->lastptime += pausedtime;
+                               ch->end += pausedtime;
+                               continue;
+                       }
+
                        // if the sound hasn't been painted last time, update his position
                        if (ch->lastptime < paintedtime)
                        {
@@ -364,9 +375,7 @@ void S_PaintChannels(int endtime)
 
                                if (stop_paint)
                                {
-                                       if (ch->sfx->fetcher->end != NULL)
-                                               ch->sfx->fetcher->end (ch);
-                                       ch->sfx = NULL;
+                                       S_StopChannel (ch - channels);
                                        break;
                                }
                        }