]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/_all.inc
Clean out self from wr_checkammo1 & wr_checkammo2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / _all.inc
index 212ba4a5de566b0b0894a336f2d6dd54365dda0e..c5e020660d3980f5f029bf97af8112b17603f6f6 100644 (file)
        #include <dpdefs/keycodes.qh>
 #endif
 
+#define USING(name, T) typedef T name
+
 #include "bool.qh"
 #include "int.qh"
 
 #include "macro.qh"
 
-#ifndef NDEBUG
+#if NDEBUG
+    #define TC(T, sym) MACRO_BEGIN MACRO_END
+#else
     #define TC(T, sym) MACRO_BEGIN \
-        if (!is_##T(sym)) LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+        if (!is_##T(sym)) { \
+            LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+            isnt_##T(sym); \
+        } \
     MACRO_END
-#else
-    #define TC(T, sym) MACRO_BEGIN MACRO_END
 #endif
 
-bool is_int(float f) { return f == f | 0; }
-bool is_bool(float f) { return f == true || f == false; }
+#define   is_float(        this) (true || ftoe(this))
+#define isnt_float(        this)
+#define   is_vector(       this) (true || vtos(this))
+#define isnt_vector(       this)
+#define   is_string(       this) (true || stof(this))
+#define isnt_string(       this)
+#define   is_entity(       this) (true || etof(this))
+#define isnt_entity(       this)
+bool      is_int(    float this) { return this == floor(this); }
+void    isnt_int(    float this) { print(ftos(this)); }
+bool      is_bool(   float this) { return this == true || this == false; }
+void    isnt_bool(   float this) { print(ftos(this)); }
 
 #include "warpzone/mathlib.qc"
 
@@ -57,6 +72,7 @@ bool is_bool(float f) { return f == true || f == false; }
 #include "functional.qh"
 #include "i18n.qh"
 #include "iter.qh"
+#include "json.qc"
 #include "lazy.qh"
 #include "linkedlist.qh"
 #include "log.qh"
@@ -87,3 +103,5 @@ bool is_bool(float f) { return f == true || f == false; }
 #include "urllib.qc"
 #include "vector.qh"
 #include "yenc.qh"
+
+#include "matrix/_mod.inc"