- if (base == "") return string_null;
- #define extensions(x) \
- x(wav) \
- x(ogg) \
- x(flac) \
- /**/
- string relative;
- #define tryext(ext) { if (fexists(strcat("sound/", relative = strcat(base, "." #ext)))) break; }
- do
- {
- extensions(tryext);
-#undef tryext
-#undef extensions
- LOG_WARNINGF("Missing sound: \"%s\"\n", strcat("sound/", base));
-#ifdef CSQC
- return string_null;
-#endif
- }
- while (0);
-#ifdef SVQC
- return strcat(base, ".wav"); // let the client engine decide
-#else
- return relative;
-#endif
- }
- METHOD(Sound, sound_precache, void(entity this))
- {
- string s = Sound_fixpath(this);