]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/_all.inc
Remove uses of WITHSELF
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / _all.inc
index 6f88d906745ce260173600b54ef85373206215a3..03b943625832c472670d76169a58a8ba32195684 100644 (file)
@@ -12,6 +12,8 @@
        #define bool float
 #endif
 
+#include <dpdefs/pre.qh>
+
 #if defined(CSQC)
        #include <dpdefs/csprogsdefs.qh>
        #include <dpdefs/keycodes.qh>
        #include <dpdefs/keycodes.qh>
 #endif
 
+#include <dpdefs/post.qh>
+
+#include "self.qh"
+
 #define USING(name, T) typedef T name
 
 #include "bool.qh"
     #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
 #endif
 
-bool is_float (float  this) { return true; }
-bool is_vector(vector this) { return true; }
-bool is_string(string this) { return true; }
-bool is_entity(entity this) { return true; }
-bool is_int   (float  this) { return this == floor(this); }
-bool is_bool  (float  this) { return this == true || this == 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"
 
@@ -63,6 +78,7 @@ bool is_bool  (float  this) { return this == true || this == false; }
 #include "functional.qh"
 #include "i18n.qh"
 #include "iter.qh"
+#include "json.qc"
 #include "lazy.qh"
 #include "linkedlist.qh"
 #include "log.qh"
@@ -80,7 +96,6 @@ bool is_bool  (float  this) { return this == true || this == false; }
 #include "registry.qh"
 #include "registry_net.qh"
 #include "replicate.qh"
-#include "self.qh"
 #include "sortlist.qc"
 #include "sort.qh"
 #include "spawnfunc.qh"
@@ -93,3 +108,5 @@ bool is_bool  (float  this) { return this == true || this == false; }
 #include "urllib.qc"
 #include "vector.qh"
 #include "yenc.qh"
+
+#include "matrix/_mod.inc"