Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/game/client/hl2mp/c_hl2mp_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,6 @@ void C_HL2MP_Player::StartSprinting( void )

m_fIsSprinting = true;
#ifdef NEO
IN_AimToggleReset();
IN_LeanToggleReset();
#endif // NEO
}
Expand Down
7 changes: 7 additions & 0 deletions src/game/client/in_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,13 @@ void ToggleKeyUp( kbutton_t *b )
b->state |= 4; // impulse up
}

void LiftAllToggleKeys()
{
for (kbutton_t* button : { &in_walk, &in_aim, &in_lean_left, &in_lean_right }) {
ToggleKeyUp(button);
}
}

#endif // NEO

void IN_CommanderMouseMoveDown( const CCommand &args ) {KeyDown(&in_commandermousemove, args[1] );}
Expand Down
1 change: 1 addition & 0 deletions src/game/client/in_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void IN_LeanReset();
void IN_SpeedReset();
void IN_LeanToggleReset();
void IN_AimToggleReset();
void LiftAllToggleKeys();
#endif // NEO

#endif // IN_MAIN_H
7 changes: 6 additions & 1 deletion src/game/client/neo/c_neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,9 @@ void C_NEO_Player::PreThink( void )
{
m_bFirstAliveTick = false;

// Toggle keys can be toggled while the player is dead, reset again on spawn
LiftAllToggleKeys();

// Reset any player explosion/shock effects
// NEO NOTE (Rain): The game already does this at CBasePlayer::Spawn, but that one's server-side,
// so it could arrive too late.
Expand Down Expand Up @@ -1271,6 +1274,7 @@ void C_NEO_Player::PostThink(void)
Weapon_SetZoom(false);
m_bInVision = m_bInThermOpticCamo = false;
IN_LeanReset();
LiftAllToggleKeys();

if (IsLocalPlayer() && GetDeathTime() != 0 && (GetTeamNumber() == TEAM_JINRAI || GetTeamNumber() == TEAM_NSF))
{
Expand Down Expand Up @@ -1656,7 +1660,7 @@ bool C_NEO_Player::ShouldDrawHL2StyleQuickHud(void)
void C_NEO_Player::Weapon_Drop(C_NEOBaseCombatWeapon *pWeapon)
{
m_bIneligibleForLoadoutPick = true;
Weapon_SetZoom(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of this line makes aim stay when dropping weapons, accident? Did you mean to replace it with IN_AimToggleReset() or something?

IN_AimToggleReset();

if (pWeapon->IsGhost())
{
Expand Down Expand Up @@ -1846,6 +1850,7 @@ void C_NEO_Player::Weapon_SetZoom(const bool bZoomIn)
else
{
m_Local.m_iHideHUD |= HIDEHUD_CROSSHAIR;
IN_AimToggleReset();
}

const int fov = GetDefaultFOV();
Expand Down
12 changes: 10 additions & 2 deletions src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern ConVar weaponstay;
#include "ui/neo_hud_crosshair.h"
#include "model_types.h"
#include "c_neo_player.h"
#include "in_main.h"
#else
#include "items.h"
#include "neo_gamerules.h"
Expand Down Expand Up @@ -501,7 +502,6 @@ float CNEOBaseCombatWeapon::GetPenetration() const
return GetWpnData().m_flPenetration;
}

#ifdef CLIENT_DLL
bool CNEOBaseCombatWeapon::Holster(CBaseCombatWeapon* pSwitchingTo)
{
#ifdef DEBUG
Expand All @@ -517,12 +517,20 @@ bool CNEOBaseCombatWeapon::Holster(CBaseCombatWeapon* pSwitchingTo)

if (pOwner)
{
pOwner->Weapon_SetZoom(false);
if (auto pNeoSwitchingTo = static_cast<CNEOBaseCombatWeapon*>(pSwitchingTo);
!pNeoSwitchingTo || (pNeoSwitchingTo && !IsAllowedToZoom(pNeoSwitchingTo)))
{
pOwner->Weapon_SetZoom(false);
}
#ifdef CLIENT_DLL
IN_AimToggleReset();
#endif // CLIENT_DLL
}

return BaseClass::Holster(pSwitchingTo);
}

#ifdef CLIENT_DLL
void CNEOBaseCombatWeapon::ItemHolsterFrame(void)
{ // Overrides the base class behaviour of reloading the weapon after its been holstered for 3 seconds
return;
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/neo/weapons/weapon_neobasecombatweapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ class CNEOBaseCombatWeapon : public CBaseHL2MPCombatWeapon

virtual void SetPickupTouch(void) override;

virtual bool Holster(CBaseCombatWeapon* pSwitchingTo) override;
#ifdef CLIENT_DLL
virtual bool Holster(CBaseCombatWeapon* pSwitchingTo);
virtual void ItemHolsterFrame() override;
virtual bool ShouldDraw(void) override;
virtual void ThirdPersonSwitch(bool bThirdPerson) override;
Expand Down