]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/self.qh
Propagate this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / self.qh
index 99bea5be7cd7ca5b0b8bc02963e4398d9ca0755c..01dd638c8115a067afac8debceb9aecb51daa033 100644 (file)
@@ -6,9 +6,16 @@
 
 // Step 1: auto oldself
 #if 1
+#if NDEBUG
        #define SELFPARAM() noref entity this = __self
        #define setself(s) (__self = s)
        #define self __self
+#else
+    noref string self_str;
+       #define SELFPARAM() self_str = "self"; noref entity this = __self
+       #define setself(s) (self_str = #s, __self = s)
+       #define self (print(__SOURCELOC__, ": ", self_str, "\n"), __self)
+#endif
 #endif
 
 // Step 2: check SELFPARAM() is present for functions that use self