Skip to content

Commit

Permalink
Merge pull request #33 from TomyLobo/fix-stuck
Browse files Browse the repository at this point in the history
Fix being stuck when dive-rolling in a place that only has enough room to go prone
  • Loading branch information
TomyLobo committed Mar 30, 2016
2 parents bada7ae + afe21bf commit 50ae936
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions mp/src/game/shared/sdk/sdk_gamemovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,7 @@ void CSDKGameMovement::RealPlayerMove (void)
{
if ( CheckInterval( STUCK ) )
{
if ( CheckStuck() )
{
// Can't move, we're stuck
return;
}
CheckStuck();
}
}

Expand Down Expand Up @@ -1918,14 +1914,29 @@ void CSDKGameMovement::Duck( void )
m_pSDKPlayer->m_Shared.EndRoll();
SetRollEyeOffset( 0.0 );

if (!CanUnduck())
if ( !CanUnprone() )
{
m_pSDKPlayer->m_Shared.SetProne(true, true);
SetProneEyeOffset(1.0);
}
else if ( !CanUnduck() )
{
FinishDuck();
}
}
// before we begin to stand up from the roll, let's make sure we don't want to go prone instead
else if ( m_pSDKPlayer->GetCurrentTime() > m_pSDKPlayer->m_Shared.GetRollTime() + ROLL_TIME )
{
// force transition to prone if there won't be room to stand/duck
if ( !CanUnprone() )
{
m_pSDKPlayer->m_Shared.EndRoll();
SetRollEyeOffset( 0.0 );
m_pSDKPlayer->m_Shared.SetProne(true, true);
SetProneEyeOffset(1.0);
}
// force transition to duck if there won't be room to stand
if ( !CanUnduck() )
else if ( !CanUnduck() )
{
SetRollEyeOffset( 0.0 );
m_pSDKPlayer->m_Shared.EndRoll();
Expand Down

0 comments on commit 50ae936

Please sign in to comment.