]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Do specific checks for sound formats
authorMario <zacjardine@y7mail.com>
Sun, 8 Feb 2015 11:32:09 +0000 (22:32 +1100)
committerMario <zacjardine@y7mail.com>
Sun, 8 Feb 2015 11:32:09 +0000 (22:32 +1100)
qcsrc/common/weapons/weapons.qc

index c119d79cd9d906149dec4c4a78dd7d7d1e800277..fe72f9e61603e28f943b3829dc38f643872ae344 100644 (file)
@@ -408,12 +408,14 @@ string W_Sound(string w_snd)
        if(autocvar_sv_weapons_sounddir != "" && autocvar_sv_weapons_sounddir != "default")
        {
                string thesnd = sprintf("weapons_%s/%s", autocvar_sv_weapons_sounddir, w_snd);
-               float globhandle = search_begin(strcat("sound/", thesnd, ".*"), true, false);
-               if(globhandle >= 0)
-               {
-                       search_end(globhandle);
+               if(fexists(strcat("sound/", thesnd, ".ogg")))
+                       return strcat(thesnd, ".wav");
+
+               if(fexists(strcat("sound/", thesnd, ".wav")))
+                       return strcat(thesnd, ".wav");
+
+               if(fexists(strcat("sound/", thesnd, ".flac")))
                        return strcat(thesnd, ".wav");
-               }
        }
        return strcat("weapons/", w_snd, ".wav");
 }