From a4451cda74d062cc6195ff4eb473f756617716d1 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 17 Apr 2017 11:49:00 +1000 Subject: [PATCH] Don't bother trying to remove and give back the buff when exiting/entering vehicle, just re-spawn the buff and let the player keep their countdown --- .../common/mutators/mutator/buffs/sv_buffs.qc | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 70217365d..461fb35af 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -260,7 +260,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) || this.pickup_anyway > 0 || (this.pickup_anyway >= 0 && autocvar_g_buffs_pickup_anyway)) + if(!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner) || !this.owner.iscreature || this.owner.vehicle || !(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; @@ -989,28 +989,6 @@ MUTATOR_HOOKFUNCTION(buffs, SpectateCopy) client.buff_time = spectatee.buff_time; } -MUTATOR_HOOKFUNCTION(buffs, VehicleEnter) -{ - entity player = M_ARGV(0, entity); - entity veh = M_ARGV(1, entity); - - veh.buffs = player.buffs; - player.buffs = 0; - veh.buff_time = max(0, player.buff_time - time); - player.buff_time = 0; -} - -MUTATOR_HOOKFUNCTION(buffs, VehicleExit) -{ - entity player = M_ARGV(0, entity); - entity veh = M_ARGV(1, entity); - - player.buffs = player.oldbuffs = veh.buffs; - veh.buffs = 0; - player.buff_time = time + veh.buff_time; - veh.buff_time = 0; -} - MUTATOR_HOOKFUNCTION(buffs, PlayerRegen) { entity player = M_ARGV(0, entity); -- 2.39.2