Skip to content

Commit

Permalink
Lower weapons on ladders. Can still reload on ladders same as when sp…
Browse files Browse the repository at this point in the history
…rinting
  • Loading branch information
AdamTadeusz committed Sep 20, 2024
1 parent e6f1020 commit 360d75d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mp/src/game/shared/neo/weapons/weapon_knife.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void CWeaponKnife::Spawn()

void CWeaponKnife::ItemPostFrame()
{
ProcessAnimationEvents();
HandleWeaponLowered();
BaseClass::ItemPostFrame();
}

Expand Down
8 changes: 4 additions & 4 deletions mp/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,20 +460,20 @@ void CNEOBaseCombatWeapon::ItemPreFrame(void)
}

// Handles lowering the weapon view model when character is sprinting
void CNEOBaseCombatWeapon::ProcessAnimationEvents(void)
void CNEOBaseCombatWeapon::HandleWeaponLowered(void)
{
CNEO_Player* pOwner = static_cast<CNEO_Player*>(ToBasePlayer(GetOwner()));
if (!pOwner)
return;

if (!m_bLowered && (pOwner->IsSprinting()) && !m_bInReload && !m_bRoundBeingChambered)
if (!m_bLowered && (pOwner->IsSprinting() || pOwner->GetMoveType() == MOVETYPE_LADDER) && !m_bInReload && !m_bRoundBeingChambered)
{
m_bLowered = true;
SendWeaponAnim(ACT_VM_IDLE_LOWERED);
m_flNextPrimaryAttack = max(gpGlobals->curtime + 0.2, m_flNextPrimaryAttack);
m_flNextSecondaryAttack = m_flNextPrimaryAttack;
}
else if (m_bLowered && !(pOwner->IsSprinting()))
else if (m_bLowered && !(pOwner->IsSprinting() || pOwner->GetMoveType() == MOVETYPE_LADDER))
{
m_bLowered = false;
SendWeaponAnim(ACT_VM_IDLE);
Expand Down Expand Up @@ -505,7 +505,7 @@ void CNEOBaseCombatWeapon::ItemPostFrame(void)
if (!pOwner)
return;

ProcessAnimationEvents();
HandleWeaponLowered();

UpdateAutoFire();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class CNEOBaseCombatWeapon : public CBaseHL2MPCombatWeapon

float GetLastAttackTime(void) const { return m_flLastAttackTime; }

virtual void ProcessAnimationEvents(void);
virtual void HandleWeaponLowered(void);
bool m_bWeaponIsLowered;

int GetNumShotsFired(void) const { return m_nNumShotsFired; }
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/shared/neo/weapons/weapon_supa7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void CWeaponSupa7::ItemPostFrame(void)
{
return;
}
ProcessAnimationEvents();
HandleWeaponLowered();

if (m_bInReload)
{
Expand Down

0 comments on commit 360d75d

Please sign in to comment.