diff --git a/source/server/weapons/bouncing_betty.qc b/source/server/weapons/bouncing_betty.qc index f008df1..a62b843 100644 --- a/source/server/weapons/bouncing_betty.qc +++ b/source/server/weapons/bouncing_betty.qc @@ -163,8 +163,7 @@ void() W_PrimeBetty = // Prevent the Player from Sprinting and also avoid issues with // the equipment being completely cancelled.. - if (self.sprinting) - W_SprintStop(); + W_SprintStop(); W_HideCrosshair(self); diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 6953d13..c0e6088 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -121,11 +121,20 @@ void() W_AimIn = if (IsDualWeapon(self.weapon) || self.reload_delay > time || self.knife_delay > time || - self.sprinting || self.new_anim_stop) { return; } + if (self.sprinting) { + W_SprintStop(); + + // FIXME: When we eventually allow custom delay values + // for every weapon animation, this hardcoded frame + // timer can be removed. + float sprint_fire_delay = fabs(GetFrame(self.weapon, SPRINT_OUT_END) - GetFrame(self.weapon, SPRINT_OUT_START))/10; + self.fire_delay = self.fire_delay2 = time + sprint_fire_delay; + } + float ads_frame = GetFrame(self.weapon, AIM_IN); if (ads_frame != 0 && self.fire_delay < time) { self.weaponframe_end = self.weaponframe = ads_frame; @@ -167,23 +176,21 @@ void() W_AimOut = void() W_SprintStop = { - if (self.sprinting) - { - self.sprint_stop_time = time; - self.sprint_duration = self.sprint_timer; - } - if (self.isBuying || !self.sprinting) return; Weapon_PlayViewModelAnimation(ANIM_SPRINT_STOP, ReturnWeaponModel, 0); + // Run Walk for a few frames to simulate an ease in velocity + PAnim_Walk6(); + self.zoom = 0; self.tp_anim_time = 0; - PAnim_Walk6(); // Run Walk for a few frames to simulate an ease in velocity self.sprinting = 0; self.into_sprint = 0; self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = 0; + self.sprint_stop_time = time; + self.sprint_duration = self.sprint_timer; } @@ -1172,7 +1179,7 @@ void() WeaponCore_Melee = // Do not trigger if we're Aiming down the Sight, or // already melee-ing, or doing some other action. if (self.knife_delay > time || self.new_anim_stop || - self.new_anim2_stop || self.zoom || !(self.flags & FL_ONGROUND)) + self.new_anim2_stop || self.zoom) return; // Perform the third person animation if standing @@ -1183,8 +1190,7 @@ void() WeaponCore_Melee = W_HideCrosshair(self); // Stop sprinting if we are - if (self.sprinting) - W_SprintStop(); + W_SprintStop(); vector applied_velocity = '0 0 0'; // The lunge velocity we intend to apply to the player. float melee_range = WepDef_GetWeaponMeleeRange(self.weapon); // Returns the range of the traceline to perform for hit detection. @@ -1268,7 +1274,7 @@ void() WeaponCore_Melee = self.knife_delay = anim_duration + time; // Now apply the lunge velocity, but only if we're Standing. - if (self.stance == PLAYER_STANCE_STAND) + if (self.stance == PLAYER_STANCE_STAND && did_lunge) self.velocity = applied_velocity; } @@ -1450,8 +1456,7 @@ void() W_Grenade = // Prevent the Player from Sprinting and also avoid issues with // the equipment being completely cancelled.. - if (self.sprinting) - W_SprintStop(); + W_SprintStop(); W_HideCrosshair(self); Set_W_Frame (0, 2, 0.6, 0, GRENADE, checkHold, "models/weapons/grenade/v_grenade.mdl", true, S_RIGHT); @@ -2124,6 +2129,15 @@ void() WeaponCore_MeleeButtonPressed = if (self.semi_actions & SEMIACTION_MELEE) return; +#ifdef FTE + + // On FTE, we should resort to standard CoD + // behavior where pressing melee should cancel + // sprinting. + W_SprintStop(); + +#endif // FTE + WeaponCore_Melee(); self.semi_actions |= SEMIACTION_MELEE; };