From bc8f083fa131e0ac511f4ee7dd093e684a9f2cd6 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Feb 2017 22:38:54 +1000 Subject: [PATCH] Add an option to disable dropping of buffs with the use key --- 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 9868c9a22..c272b5bd6 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -299,6 +299,7 @@ set g_buffs_random_location 0 "randomize buff location on start and when reset" set g_buffs_random_location_attempts 10 "number of random locations a single buff will attempt to respawn at before giving up" set g_buffs_spawn_count 0 "how many buffs to spawn on the map if none exist already" set g_buffs_replace_powerups 0 "replace powerups on the map with random buffs" +set g_buffs_drop 1 "allow dropping buffs" set g_buffs_cooldown_activate 5 "cooldown period when buff is first activated" set g_buffs_cooldown_respawn 3 "cooldown period when buff is reloading" set g_buffs_ammo 1 "ammo buff: infinite ammunition" diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index b458f735e..c02ac5687 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -629,7 +629,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDies) MUTATOR_HOOKFUNCTION(buffs, PlayerUseKey, CBC_ORDER_FIRST) { - if(MUTATOR_RETURNVALUE || game_stopped) return; + if(MUTATOR_RETURNVALUE || game_stopped || !autocvar_g_buffs_drop) return; entity player = M_ARGV(0, entity); diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh index b26d51ce2..4d9f107af 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh @@ -14,6 +14,7 @@ bool autocvar_g_buffs_random_location; int autocvar_g_buffs_random_location_attempts; int autocvar_g_buffs_spawn_count; bool autocvar_g_buffs_replace_powerups; +bool autocvar_g_buffs_drop = true; float autocvar_g_buffs_cooldown_activate; float autocvar_g_buffs_cooldown_respawn; float autocvar_g_buffs_resistance_blockpercent; -- 2.39.2