Guest User

Untitled

a guest
Sep 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. void CBasePlayer::Jump()
  2. {
  3. Vector vecWallCheckDir;// direction we're tracing a line to find a wall when walljumping
  4. Vector vecAdjustedVelocity;
  5. Vector vecSpot;
  6. TraceResult tr;
  7.  
  8. if (FBitSet(pev->flags, FL_WATERJUMP))
  9. return;
  10.  
  11. if (pev->waterlevel >= 2)
  12. {
  13. return;
  14. }
  15.  
  16. // jump velocity is sqrt( height * gravity * 2)
  17.  
  18. // If this isn't the first frame pressing the jump button, break out.
  19. if ( !FBitSet( m_afButtonPressed, IN_JUMP ) )
  20. return; // don't pogo stick
  21.  
  22. if ( !(pev->flags & FL_ONGROUND) || !pev->groundentity )
  23. {
  24. return;
  25. }
  26.  
  27. // many features in this function use v_forward, so makevectors now.
  28. UTIL_MakeVectors (pev->angles);
  29.  
  30. // ClearBits(pev->flags, FL_ONGROUND); // don't stairwalk
  31.  
  32. SetAnimation( PLAYER_JUMP );
  33.  
  34. if ( m_fLongJump &&
  35. (pev->button & IN_DUCK) &&
  36. ( pev->flDuckTime > 0 ) &&
  37. pev->velocity.Length() > 50 )
  38. {
  39. SetAnimation( PLAYER_SUPERJUMP );
  40. }
  41.  
  42. // If you're standing on a conveyor, add it's velocity to yours (for momentum)
  43. entvars_t *pevGround = VARS(pev->groundentity);
  44. if ( pevGround && (pevGround->flags & FL_CONVEYOR) )
  45. {
  46. pev->velocity = pev->velocity + pev->basevelocity;
  47. }
  48. }
Add Comment
Please, Sign In to add comment