Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lean reset on death, do Lean even when dead as long as leaning for smooth unlean #795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions mp/src/game/client/in_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ void IN_LeanRightToggle(const CCommand& args)
KeyUp(&in_lean_left, args[1]);
}
}

void LeanReset()
{
KeyUp(&in_lean_right, nullptr);
KeyUp(&in_lean_left, nullptr);
}
#endif

void IN_DuckToggle( const CCommand &args )
Expand Down
2 changes: 2 additions & 0 deletions mp/src/game/client/in_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
extern kbutton_t in_commandermousemove;
extern kbutton_t in_ducktoggle;

void LeanReset();

#endif // IN_MAIN_H
9 changes: 7 additions & 2 deletions mp/src/game/client/neo/c_neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "dlight.h"

#include "iinput.h"
#include "in_main.h"

#include "clientmode_hl2mpnormal.h"
#include <vgui/IScheme.h>
Expand Down Expand Up @@ -914,7 +915,6 @@ void C_NEO_Player::PreThink( void )
}
#endif // GLOWS_ENABLE
}
Lean();
}
else
{
Expand All @@ -924,6 +924,11 @@ void C_NEO_Player::PreThink( void )
}
}

if (IsAlive() || m_vecLean != vec3_origin)
{
Lean();
}

// Eek. See rationale for this thing in CNEO_Player::PreThink
if (IsAirborne())
{
Expand Down Expand Up @@ -1048,7 +1053,7 @@ void C_NEO_Player::PostThink(void)

Weapon_SetZoom(false);
m_bInVision = false;
m_bInLean = NEO_LEAN_NONE;
LeanReset();

if (IsLocalPlayer() && (GetTeamNumber() == TEAM_JINRAI || GetTeamNumber() == TEAM_NSF))
{
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ void CNEO_Player::PreThink(void)
m_flCamoAuxLastTime = 0;
}

if (IsAlive())
if (IsAlive() || m_vecLean != vec3_origin)
{
Lean();
}
Expand Down