]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qh
Simpler function accumulation. Thanks, graphitemaster.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qh
index 47865428c18f5a8869e295f42a0e99eebfda886f..166af391e9574b7d6e5e7f7867bab05ab43c2e7f 100644 (file)
@@ -6,6 +6,12 @@
 // a dummy macro that prevents the "hanging ;" warning
 #define ENDS_WITH_CURLY_BRACE
 
+#ifdef GMQCC
+# define ACCUMULATE_FUNCTION(func,otherfunc) \
+       [[accumulate]] void func() { otherfunc(); }
+# define CALL_ACCUMULATED_FUNCTION(func) \
+       func()
+#else
 #ifdef HAVE_YO_DAWG_CPP
 // TODO make ascii art pic of xzibit
 // YO DAWG!
@@ -24,7 +30,7 @@
        func()
 #else
 # define ACCUMULATE_FUNCTION(func,otherfunc) \
-       .void _ACCUMULATE_##func##__##otherfunc;
+       .float _ACCUMULATE_##func##__##otherfunc
 void ACCUMULATE_call(string func)
 {
        float i;
@@ -41,6 +47,7 @@ void ACCUMULATE_call(string func)
 # define CALL_ACCUMULATED_FUNCTION(func) \
        ACCUMULATE_call(#func)
 #endif
+#endif
 
 // used for simplifying ACCUMULATE_FUNCTIONs
 #define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
@@ -220,8 +227,10 @@ string RandomSelection_chosen_string;
 void RandomSelection_Init();
 void RandomSelection_Add(entity e, float f, string s, float weight, float priority);
 
-vector healtharmor_maxdamage(float h, float a, float armorblock); // returns vector: maxdamage, armorideal, 1 if fully armored
-vector healtharmor_applydamage(float a, float armorblock, float damage); // returns vector: take, save, 0
+#ifndef MENUQC
+vector healtharmor_maxdamage(float h, float a, float armorblock, float deathtype); // returns vector: maxdamage, armorideal, 1 if fully armored
+vector healtharmor_applydamage(float a, float armorblock, float deathtype, float damage); // returns vector: take, save, 0
+#endif
 
 string getcurrentmod();