Skip to content

Fix not being able to wallflip in some places #52

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

Merged
merged 4 commits into from
Apr 24, 2016
Merged
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions mp/src/game/shared/sdk/sdk_gamemovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2669,7 +2669,9 @@ void CSDKGameMovement::FullWalkMove ()
if (m_pSDKPlayer->IsStyleSkillActive(SKILL_ATHLETIC))
iWallflips = 9999;

if (!player->m_Local.m_bDucked && !m_pSDKPlayer->m_Shared.IsProne() && m_pSDKPlayer->m_Shared.GetWallFlipCount() < iWallflips)
if (!player->m_Local.m_bDucked && !m_pSDKPlayer->m_Shared.IsProne() && m_pSDKPlayer->m_Shared.GetWallFlipCount() < iWallflips
// Don't flip if the player is sliding or getting up from sliding.
&& !m_pSDKPlayer->m_Shared.IsSliding() && !m_pSDKPlayer->m_Shared.IsGettingUpFromProne() && !m_pSDKPlayer->m_Shared.IsGettingUpFromSlide())
{
trace_t tr;
Vector org, mins, maxs;
Expand All @@ -2692,9 +2694,7 @@ void CSDKGameMovement::FullWalkMove ()
// Don't flip if the surface is skybox.
// Don't flip if the surface isn't a wall.
// Don't flip if the player isn't at least sorta facing the wall.
// Don't flip if the player is sliding or getting up from sliding.
if (tr.fraction < 1 && !(tr.surface.flags & (SURF_SKY | SURF_NODRAW)) && fabs(tr.plane.normal[2]) < 0.7 && vecForward.Dot(tr.plane.normal) < -0.7f
&& !m_pSDKPlayer->m_Shared.IsSliding() && !m_pSDKPlayer->m_Shared.IsGettingUpFromProne() && !m_pSDKPlayer->m_Shared.IsGettingUpFromSlide())
if (tr.fraction < 1 && !(tr.surface.flags & (SURF_SKY | SURF_NODRAW)) && fabs(tr.plane.normal[2]) < 0.7 && vecForward.Dot(tr.plane.normal) < -0.7f)
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure why moving this does anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At first I planned to duplicate the entire section to do two traces, but it turned out to be unnecessary.
I left the move in because we save some traces here in the general case.

{
m_pSDKPlayer->m_Shared.EndDive();
m_pSDKPlayer->m_Shared.EndRoll();
Expand Down