]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/buffs/module.inc
Gametype Votescreen: Remove the _icon cvar for custom gametypes as it is not needed...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / buffs / module.inc
index be00977148ef05ad8bdf2a55ff534454c8305e65..c24892836a88d5a619b17eb4ae1d3ac7746d643b 100644 (file)
@@ -11,14 +11,14 @@ string BUFF_NAME(int i)
     return sprintf("%s%s", rgb_to_hexcolor(b.m_color), b.m_prettyName);
 }
 
-#ifndef MENUQC
-REGISTER_MUTATOR(buffs_flight, true);
-MUTATOR_HOOKFUNCTION(buffs_flight, IsFlying)
+entity buff_FirstFromFlags(int _buffs)
 {
-    noref entity e = MUTATOR_ARGV(0, entity);
-       return BUFFS_STAT(e) & BUFF_FLIGHT.m_itemid;
+    if (flags)
+    {
+        FOREACH(Buffs, it.m_itemid & _buffs, LAMBDA(return it));
+    }
+    return BUFF_Null;
 }
-#endif
 
 #ifdef CSQC
 REGISTER_MUTATOR(cl_buffs, true);
@@ -31,13 +31,13 @@ MUTATOR_HOOKFUNCTION(cl_buffs, HUD_Powerups_add)
 }
 MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
 {
-    entity this = MUTATOR_ARGV(0, entity);
-    string s = MUTATOR_ARGV(0, string);
+    entity this = M_ARGV(0, entity);
+    string s = M_ARGV(1, string);
     if (s == WP_Buff.netname || s == RADARICON_Buff.netname)
     {
         Buff b = Buffs_from(this.wp_extra);
-        MUTATOR_ARGV(0, vector) = b.m_color;
-        MUTATOR_ARGV(0, string) = b.m_prettyName;
+        M_ARGV(2, vector) = b.m_color;
+        M_ARGV(3, string) = b.m_prettyName;
         return true;
     }
 }