X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qc;h=b972cfdec4adfa1a74a6d7ef24b4c6c7dc6b9498;hb=96e1acc3050bcb718e2f06702e5b88a60459a015;hp=7d5ef31eecef27277ed8c73d1b92456c0e6a2bb0;hpb=2718fac2d710f2c4e63a6de3cfe0ffc66dc7d6a3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 7d5ef31ee..b972cfdec 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -9,7 +9,6 @@ #include "../constants.qh" #include "../stats.qh" #include "../../warpzonelib/anglestransform.qh" - #include "../../warpzonelib/mathlib.qh" #include "../../warpzonelib/common.qh" #include "../../warpzonelib/client.qh" #include "../util.qh" @@ -25,7 +24,6 @@ #include "../../dpdefs/progsdefs.qh" #include "../../dpdefs/dpextensions.qh" #include "../../warpzonelib/anglestransform.qh" - #include "../../warpzonelib/mathlib.qh" #include "../../warpzonelib/common.qh" #include "../../warpzonelib/util_server.qh" #include "../../warpzonelib/server.qh" @@ -333,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;