]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/_all.inc
Make it compile without XONOTIC defined
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / _all.inc
index 1d63a28e540425d8e6b12e5fcbf0fd853f652aca..6408d6e3f2502aceebbe720c3151ccd8576dd9c2 100644 (file)
@@ -55,7 +55,7 @@
 #else
        #define TC(T, sym) MACRO_BEGIN \
                if (!is_##T(sym)) { \
-                       LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+                       LOG_WARNF("Type check failed: " #sym " :: " #T); \
                        isnt_##T(sym); \
                } \
        MACRO_END
@@ -89,6 +89,7 @@ void    isnt_bool(float this) { print(ftos(this)); }
 #include "file.qh"
 #include "functional.qh"
 #include "i18n.qh"
+#include "intrusivelist.qh"
 #include "iter.qh"
 #include "json.qc"
 #include "lazy.qh"
@@ -123,6 +124,22 @@ void    isnt_bool(float this) { print(ftos(this)); }
 
 #include "matrix/_mod.inc"
 
+#ifndef SVQC
+#define objerror_safe(e)
+#else
+void make_safe_for_remove(entity this);
+    #define objerror_safe(e) make_safe_for_remove(e)
+#endif
+
+#define objerror(this, msg) MACRO_BEGIN { \
+       LOG_WARN("======OBJECT ERROR======"); \
+       entity _e = (this); \
+       eprint(_e); \
+       objerror_safe(_e); \
+       delete(_e); \
+       LOG_WARNF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \
+} MACRO_END
+
 #ifdef MENUQC
        void _m_init();
        void m_init() { if (_m_init) _m_init(); }
@@ -249,7 +266,8 @@ void    isnt_bool(float this) { print(ftos(this)); }
 #endif
 #undef ENGINE_EVENT
 
-#ifndef MENUQC
-       #include <ecs/_lib.qh>
-       #include <ecs/components/_mod.qh>
+#if XONOTIC
+#ifdef GAMEQC
+       #include <ecs/_mod.qh>
+#endif
 #endif