]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a check
authorterencehill <piuntn@gmail.com>
Sat, 2 May 2020 09:13:29 +0000 (11:13 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 2 May 2020 09:13:29 +0000 (11:13 +0200)
qcsrc/common/mutators/mutator/buffs/cl_buffs.qc

index 790a10a86b8f16da4b5f0f0f65900d1813ca89a2..349ca20b872c17f468117dccecaa1152128778ca 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_name, strcat("buff_", it.netname), 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)
 {