From: Mario Date: Sun, 8 Feb 2015 11:32:09 +0000 (+1100) Subject: Do specific checks for sound formats X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c11d2fa7a42008982a71f98f3ddbb7cef0c98dc2;p=xonotic%2Fxonotic-data.pk3dir.git Do specific checks for sound formats --- diff --git a/qcsrc/common/weapons/weapons.qc b/qcsrc/common/weapons/weapons.qc index c119d79cd..fe72f9e61 100644 --- a/qcsrc/common/weapons/weapons.qc +++ b/qcsrc/common/weapons/weapons.qc @@ -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"); }