From: terencehill Date: Sat, 2 May 2020 09:13:29 +0000 (+0200) Subject: Add a check X-Git-Tag: xonotic-v0.8.5~1093 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c55c3d10553f5800af1f0702fa03e78067eb45a;p=xonotic%2Fxonotic-data.pk3dir.git Add a check --- diff --git a/qcsrc/common/mutators/mutator/buffs/cl_buffs.qc b/qcsrc/common/mutators/mutator/buffs/cl_buffs.qc index 790a10a86..349ca20b8 100644 --- a/qcsrc/common/mutators/mutator/buffs/cl_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/cl_buffs.qc @@ -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) {