]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't allow giving buffs that are disabled, fixes #2437
authorMario <mario.mario@y7mail.com>
Tue, 5 May 2020 19:56:01 +0000 (05:56 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 5 May 2020 19:56:15 +0000 (05:56 +1000)
qcsrc/common/mutators/mutator/buffs/sv_buffs.qh
qcsrc/common/t_items.qc

index 88efc94ebb298e7df9158a872a274abb22e14fce..b585811873758a94aee4a68592364f36ca749005 100644 (file)
@@ -82,3 +82,5 @@ const vector BUFF_MAX = ('16 16 60');
 
 // client side options
 .float cvar_cl_buffs_autoreplace;
+
+float buff_Available(entity buff);
index d9bd7bdc9606d8b1399bc89efabede0f952d0c78..6f385cdb4e019796254f09e492fb6a84d726f692 100644 (file)
@@ -23,6 +23,7 @@
     #include <common/weapons/_all.qh>
 
     #include <common/mutators/mutator/buffs/buffs.qh>
+       #include <common/mutators/mutator/buffs/sv_buffs.qh>
 
     #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;