]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix "system vars have been modified" CRC mismatch
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 29 Aug 2015 06:21:30 +0000 (16:21 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 29 Aug 2015 06:22:21 +0000 (16:22 +1000)
qcsrc/common/util-pre.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/lib/Bool.qh [new file with mode: 0644]
qcsrc/lib/_all.inc
qcsrc/server/miscfunctions.qc

index b96e78d514f6832d6c39cfae274e678b641761e9..b81fd2a6df81d409626458a4ba338a15273796f2 100644 (file)
     #define itos(i) ftos(i)
 #endif
 
-#ifndef QCC_SUPPORT_BOOL
-    #define bool float
-
-    // Boolean Constants
-    const int true     = 1;
-    const int false = 0;
-#endif
-
-// Transitional aliases
-[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
-[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
-
 #define FOREACH_ARRAY(arr, start, end, cond, body) do { \
     for (int i = start; i < end; ++i) {                 \
         const noref entity it = arr[i];                 \
index eb744a98949ae5ccdc4d2325b8359a1998521fdf..8c1e127dcd7934cef61e8d23b5a88063c591c893 100644 (file)
@@ -2306,27 +2306,6 @@ string MakeConsoleSafe(string input)
        return input;
 }
 
-#ifndef MENUQC
-// get true/false value of a string with multiple different inputs
-float InterpretBoolean(string input)
-{
-       switch(strtolower(input))
-       {
-               case "yes":
-               case "true":
-               case "on":
-                       return true;
-
-               case "no":
-               case "false":
-               case "off":
-                       return false;
-
-               default: return stof(input);
-       }
-}
-#endif
-
 #ifdef CSQC
 entity ReadCSQCEntity()
 {
index 8a77ba18ffdcc7b9fdeeb712f4e3a08ed699a68a..e3fab47b7da6d9961c982b9eda081f71a6bbde7f 100644 (file)
@@ -246,10 +246,6 @@ string strtolower(string s);
 
 string MakeConsoleSafe(string input);
 
-#ifndef MENUQC
-float InterpretBoolean(string input);
-#endif
-
 // generic shutdown handler
 void Shutdown();
 
diff --git a/qcsrc/lib/Bool.qh b/qcsrc/lib/Bool.qh
new file mode 100644 (file)
index 0000000..26169cd
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef BOOL_H
+#define BOOL_H
+
+#ifndef QCC_SUPPORT_BOOL
+    #define bool float
+
+    // Boolean Constants
+    const int true     = 1;
+    const int false = 0;
+#endif
+
+// Transitional aliases
+[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
+[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
+
+// get true/false value of a string with multiple different inputs
+float InterpretBoolean(string input)
+{
+    switch (strtolower(input))
+    {
+        case "yes":
+        case "true":
+        case "on":
+            return true;
+
+        case "no":
+        case "false":
+        case "off":
+            return false;
+
+        default: return stof(input);
+    }
+}
+
+float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
+    return (value == 0) ? false : true;
+}
+
+#endif
index ba432ad2a08cfa4f2b4833722ca1bc9190e6e018..4e0b12f255dbea477471c539aadd46dad8bdd648 100644 (file)
@@ -1,3 +1,5 @@
+#include "Bool.qh"
+
 #include "../warpzonelib/mathlib.qc"
 
 #include "Accumulate.qh"
index 0dabbf0fa38df393b90c894315ffc61028144a3f..60640441a333fad861f8e1a9849f529863296e30 100644 (file)
@@ -312,10 +312,6 @@ string formatmessage(string msg)
        return msg;
 }
 
-float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
-       return (value == 0) ? false : true;
-}
-
 /*
 =============
 GetCvars