From: Mario Date: Tue, 5 May 2020 19:56:01 +0000 (+1000) Subject: Don't allow giving buffs that are disabled, fixes #2437 X-Git-Tag: xonotic-v0.8.5~1091 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2babd132645c34ccb808385a8d8c235e06fa74ef;p=xonotic%2Fxonotic-data.pk3dir.git Don't allow giving buffs that are disabled, fixes #2437 --- diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh index 88efc94eb..b58581187 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh @@ -82,3 +82,5 @@ const vector BUFF_MAX = ('16 16 60'); // client side options .float cvar_cl_buffs_autoreplace; + +float buff_Available(entity buff); diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index d9bd7bdc9..6f385cdb4 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -23,6 +23,7 @@ #include #include + #include #include "../lib/warpzone/util_server.qh" #elif defined(CSQC) @@ -1827,7 +1828,7 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveResourceValue(e, RES_FUEL, op, val); break; default: - FOREACH(Buffs, it != BUFF_Null && Buff_UndeprecateName(cmd) == it.netname, + FOREACH(Buffs, it != BUFF_Null && buff_Available(it) && Buff_UndeprecateName(cmd) == it.netname, { got += GiveBuff(e, it, op, val); break;