]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/buffs/cl_buffs.qc
Merge branch 'master' into Lyberta/WaypointIcons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / buffs / cl_buffs.qc
index f751eecff091ff08e775bde798813d748fdb0b2f..f33e3ff63a93fe1a1bbea3dfb5936f3a09f108d6 100644 (file)
@@ -3,10 +3,11 @@
 REGISTER_MUTATOR(cl_buffs, true);
 MUTATOR_HOOKFUNCTION(cl_buffs, HUD_Powerups_add)
 {
-    int allBuffs = STAT(BUFFS);
-    FOREACH(Buffs, it.m_itemid & allBuffs, {
-               addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
-       });
+       int allBuffs = STAT(BUFFS);
+       if (allBuffs)
+               FOREACH(Buffs, it.m_itemid & allBuffs, {
+                       addPowerupItem(it.m_name, strcat("buff_", it.netname), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
+               });
 }
 MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
 {
@@ -14,10 +15,10 @@ MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
     string s = M_ARGV(1, string);
     if (s == WP_Buff.netname || s == RADARICON_Buff.netname)
     {
-        Buff b = Buffs_from(this.wp_extra);
+        Buff b = REGISTRY_GET(Buffs, this.wp_extra);
         M_ARGV(2, vector) = b.m_color;
-        M_ARGV(3, string) = b.m_prettyName;
-        M_ARGV(4, string) = strcat("buff_", b.m_name);
+        M_ARGV(3, string) = b.m_name;
+        M_ARGV(4, string) = strcat("buff_", b.netname);
         return true;
     }
 }