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 88efc94..b585811 100644 (file)
@@ -82,3 +82,5 @@ const vector BUFF_MAX = ('16 16 60');
 
 // client side options
 .float cvar_cl_buffs_autoreplace;
 
 // client side options
 .float cvar_cl_buffs_autoreplace;
+
+float buff_Available(entity buff);
index d9bd7bd..6f385cd 100644 (file)
@@ -23,6 +23,7 @@
     #include <common/weapons/_all.qh>
 
     #include <common/mutators/mutator/buffs/buffs.qh>
     #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)
 
     #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:
                                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;
                                {
                                        got += GiveBuff(e, it, op, val);
                                        break;