From c11d2fa7a42008982a71f98f3ddbb7cef0c98dc2 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 8 Feb 2015 22:32:09 +1100 Subject: [PATCH] Do specific checks for sound formats --- qcsrc/common/weapons/weapons.qc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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"); } -- 2.39.2