From fd2899a360c7476c7b898f37f88f49e53e9bf76a Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 6 Feb 2017 03:12:36 +1000 Subject: [PATCH] Add an option to respawn buffs even if they're held --- mutators.cfg | 1 + qcsrc/common/mutators/mutator/buffs/sv_buffs.qc | 2 +- qcsrc/common/mutators/mutator/buffs/sv_buffs.qh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mutators.cfg b/mutators.cfg index d6ffe0c63..9868c9a22 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -291,6 +291,7 @@ set cl_buffs_autoreplace 1 "automatically drop current buff when picking up anot set g_buffs -1 "enable buffs (requires buff items or powerups)" set g_buffs_effects 1 "show particle effects from carried buffs" set g_buffs_waypoint_distance 1024 "maximum distance at which buff waypoint can be seen from item" +set g_buffs_pickup_anyway 0 "instantly respawn the buff when it is picked up, instead of waiting for the player to drop it" set g_buffs_pickup_delay 0.7 "cooldown before player can pick up another buff after dropping one" set g_buffs_randomize 1 "randomize buff type when player drops buff" set g_buffs_random_lifetime 30 "re-spawn the buff again if it hasn't been touched after this time in seconds" diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index a9dd6574d..b458f735e 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -258,7 +258,7 @@ void buff_Think(entity this) } if(!this.buff_active && !this.buff_activetime) - if(!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner) || !this.owner.iscreature || !(this.owner.buffs & this.buffs)) + if(!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner) || !this.owner.iscreature || !(this.owner.buffs & this.buffs) || this.pickup_anyway > 0 || (this.pickup_anyway >= 0 && autocvar_g_buffs_pickup_anyway)) { buff_SetCooldown(this, autocvar_g_buffs_cooldown_respawn + frametime); this.owner = NULL; diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh index f738e9d9d..b26d51ce2 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh @@ -6,6 +6,7 @@ bool autocvar_g_buffs_effects; float autocvar_g_buffs_waypoint_distance; +bool autocvar_g_buffs_pickup_anyway = false; float autocvar_g_buffs_pickup_delay = 0.7; bool autocvar_g_buffs_randomize; float autocvar_g_buffs_random_lifetime; -- 2.39.2