From: TimePath Date: Wed, 26 Aug 2015 23:05:35 +0000 (+1000) Subject: Fix unarchived cvars X-Git-Tag: xonotic-v0.8.2~2023 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4b58d4bcc6769c7047225a9840cea3515a3c5da1;p=xonotic%2Fxonotic-data.pk3dir.git Fix unarchived cvars --- diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh index fc916d4db..b96e78d51 100644 --- a/qcsrc/common/util-pre.qh +++ b/qcsrc/common/util-pre.qh @@ -117,8 +117,4 @@ #define BITSET(var, mask, flag) ((var) ^ (-(flag) ^ (var)) & (mask)) #endif -#define CVAR_DESCRIBE(var, desc) localcmd(sprintf("\nset %s \"%s\" \"%s\"\n", #var, ftos(autocvar_##var), desc)) -#define CVAR_DESCRIBESTR(var, desc) localcmd(sprintf("\nset %s \"%s\" \"%s\"\n", #var, autocvar_##var, desc)) -#define CVAR_DESCRIBEVEC(var, desc) localcmd(sprintf("\nset %s \"%s %s %s\" \"%s\"\n", #var, ftos(autocvar_##var##.x), ftos(autocvar_##var##.y), ftos(autocvar_##var##.z), desc)) - #endif diff --git a/qcsrc/lib/Cvar.qh b/qcsrc/lib/Cvar.qh new file mode 100644 index 000000000..98d5b041c --- /dev/null +++ b/qcsrc/lib/Cvar.qh @@ -0,0 +1,8 @@ +#ifndef CVAR_H +#define CVAR_H + +#define CVAR_DESCRIBE(var, desc) localcmd(sprintf("\nseta %s \"%s\" \"%s\"\n", #var, ftos(autocvar_##var), desc)) +#define CVAR_DESCRIBESTR(var, desc) localcmd(sprintf("\nseta %s \"%s\" \"%s\"\n", #var, autocvar_##var, desc)) +#define CVAR_DESCRIBEVEC(var, desc) localcmd(sprintf("\nseta %s \"%v\" \"%s\"\n", #var, autocvar_##var, desc)) + +#endif diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index ad82078a1..288553278 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -1 +1,2 @@ +#include "Cvar.qh" #include "Lazy.qh"