SERVER: Prevent cancellation of weapon swap before Perk-A-Cola animation

This commit is contained in:
cypress 2024-01-07 18:44:47 -05:00
parent 35bbd002ff
commit 2ccd55a2b5

View file

@ -137,14 +137,6 @@ void DrinkPerk() {
// after this instruction to have a valid skin.
self.weaponskin = machine.sequence - 1;
self.isBuying = true;
if (self.sprinting) {
self.sprinting = 0;
self.zoom = 0;
}
self.maxspeed *= GetWeaponWalkSpeed(self.perks, self.weapon);
self.knife_delay = self.reload_delay2 = self.fire_delay2 = self.fire_delay = self.reload_delay = 3 + time;
@ -323,6 +315,9 @@ void() touch_perk =
entity tempe = self; // Set machine to tempe
self = other; // Set self to client
self.usedent = tempe; // Set usedent to machine
self.isBuying = true; // To avoid canceling the animation from triggering
self.sprinting = false;
self.zoom = 0;
Weapon_PlayViewModelAnimation(ANIM_PUT_AWAY, DrinkPerk, getWeaponDelay(self.weapon, PUTOUT));
other = self; // Set other to client
self = tempe; // Set self to machine