From: Mario Date: Mon, 17 Apr 2017 01:49:00 +0000 (+1000) Subject: Don't bother trying to remove and give back the buff when exiting/entering vehicle... X-Git-Tag: xonotic-v0.8.5~2834 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4451cda74d062cc6195ff4eb473f756617716d1;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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);