]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/_all.inc
Client: Type check
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / _all.inc
index 212ba4a5de566b0b0894a336f2d6dd54365dda0e..97d560b5c4708542a199781e853fa87b2b99af1d 100644 (file)
 
 #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); \
     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; }
+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; }
 
 #include "warpzone/mathlib.qc"