]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix unarchived cvars
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 26 Aug 2015 23:05:35 +0000 (09:05 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 26 Aug 2015 23:05:35 +0000 (09:05 +1000)
qcsrc/common/util-pre.qh
qcsrc/lib/Cvar.qh [new file with mode: 0644]
qcsrc/lib/_all.inc

index fc916d4dba37a17b182ee007f5ff9e21927a078a..b96e78d514f6832d6c39cfae274e678b641761e9 100644 (file)
     #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 (file)
index 0000000..98d5b04
--- /dev/null
@@ -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
index ad82078a18704e8830bd0a34da62c8ca52f3df70..2885532780a4f8b18b195cc48deaa8d9e8acaed5 100644 (file)
@@ -1 +1,2 @@
+#include "Cvar.qh"
 #include "Lazy.qh"