X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qc;h=b972cfdec4adfa1a74a6d7ef24b4c6c7dc6b9498;hb=96e1acc3050bcb718e2f06702e5b88a60459a015;hp=046298a4c4f97c7bd2111a74503b2ac7483d46c6;hpb=c1b058929459a95a525deff9e0ebb76a513a7c22;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 046298a4c..b972cfdec 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -331,7 +331,16 @@ int GetAmmoStat(.int ammotype) string W_Sound(string w_snd) { - string output = strcat("weapons/", w_snd, ".wav"); + #define extensions(X) X(wav) X(ogg) + #define tryext(ext) { if (fexists(strcat("sound/", output = strcat("weapons/", w_snd, "."#ext)))) break; } + string output; + do { + extensions(tryext); + #undef tryext + #undef extensions + output = strcat("weapons/", w_snd); + } while (0); + #ifdef SVQC MUTATOR_CALLHOOK(WeaponSound, w_snd, output); return weapon_sound_output;