]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to respawn buffs even if they're held
authorMario <mario@smbclan.net>
Sun, 5 Feb 2017 17:12:36 +0000 (03:12 +1000)
committerMario <mario@smbclan.net>
Sun, 5 Feb 2017 17:12:36 +0000 (03:12 +1000)
mutators.cfg
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qh

index d6ffe0c6391f14b0111a18324ed44e2cdf93784b..9868c9a221f7ea2e38a2f050a28b6351acda1e63 100644 (file)
@@ -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"
index a9dd6574d1c9e48d03cd7113ec70fdbb8d4c7ae0..b458f735e1301108cab62f6fdf9ea5f3e9f363eb 100644 (file)
@@ -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;
index f738e9d9d71fcd2a9f16f9232d6b0d3afbe92b3c..b26d51ce2779b92663391a651183e6358db50555 100644 (file)
@@ -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;