return;
}
- if((this.team && DIFF_TEAM(toucher, this))
- || (STAT(FROZEN, toucher))
- || (toucher.vehicle)
- || (time < toucher.buff_shield)
- || (!this.buff_active)
- )
- {
- // can't touch this
+ if(!this.buff_active)
return;
- }
if(MUTATOR_CALLHOOK(BuffTouch, this, toucher))
return;
if(!IS_PLAYER(toucher))
return; // incase mutator changed toucher
+ if((this.team && DIFF_TEAM(toucher, this))
+ || (STAT(FROZEN, toucher))
+ || (toucher.vehicle)
+ || (time < PS(toucher).buff_shield)
+ )
+ {
+ // can't touch this
+ return;
+ }
+
if (toucher.buffs)
{
if (toucher.cvar_cl_buffs_autoreplace && toucher.buffs != this.buffs)
player.buffs = 0;
player.buff_time = 0;
- player.buff_shield = time + 0.5; // prevent picking up buffs immediately
+ PS(player).buff_shield = time + 0.5; // prevent picking up buffs immediately
// reset timers here to prevent them continuing after re-spawn
player.buff_disability_time = 0;
player.buff_disability_effect_time = 0;
Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
player.buffs = 0;
- player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
+ PS(player).buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
//player.buff_time = 0; // already notified
sound(player, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
return true;
else
Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
player.buffs = 0;
- player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay); // always put in a delay, even if small
+ PS(player).buff_shield = time + max(0, autocvar_g_buffs_pickup_delay); // always put in a delay, even if small
}
}
ATTRIB(Player, ballistics_density, float, this.ballistics_density);
ATTRIB(Player, prevstrengthsound, float, this.prevstrengthsound);
ATTRIB(Player, prevstrengthsoundattempt, float, this.prevstrengthsoundattempt);
+ ATTRIB(Player, buff_shield, float, this.buff_shield);
INIT(Player) {
this.classname = STR_PLAYER;