- if (auto) break; \
- setorigin(__e, old_origin); \
- setsize(__e, old_mins, old_maxs); \
- } \
- while (0)
+ if (!auto) \
+ { \
+ setorigin(__e, old_origin); \
+ setsize(__e, old_mins, old_maxs); \
+ } \
+ } MACRO_END
+
+string _Sound_fixpath(string base)
+{
+ if (base == "") return string_null;
+#ifdef SVQC
+ return strcat(base, ".wav"); // let the client engine decide
+#else
+#define extensions(x) \
+ x(wav) \
+ x(ogg) \
+ x(flac) \
+ /**/
+#define tryext(ext) { \
+ string s = strcat(base, "." #ext); \
+ if (fexists(strcat("sound/", s))) { \
+ return s; \
+ } \
+ }
+ extensions(tryext);
+ LOG_WARNF("Missing sound: \"%s\"", strcat("sound/", base));
+#undef tryext
+#undef extensions
+ return string_null;
+#endif
+}