Fightaw

Weapon Accuracy

Jan 22nd, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. if ( ent->client->ps.weapon == WP_BLASTER )
  2.     slopFactor = 0.2;
  3. else if ( ent->client->ps.weapon == WP_DISRUPTOR )
  4.     slopFactor = 0.1;
  5.    
  6. //Crouching = more accurate
  7. if ( ent->client->ps.pm_flags & PMF_DUCKED )
  8.     slopFactor *= 0.030000;
  9. else
  10.     slopFactor *= 0.055555;
  11.  
  12. //If they're running, make them less accurate
  13. if( PM_RunningAnim( ent->client->ps.legsAnim ) )
  14.     slopFactor *= 0.033333;
  15. //If they're running, make them less accurate(not as inaccurate as running, though)
  16. if( PM_WalkingAnim( ent->client->ps.legsAnim ) )
  17.     slopFactor *= 0.888888;
  18.  
  19. //[/OpenRP - Weapon Accuracy]
  20.  
  21. vectoangles( forward, angs );
  22. angs[PITCH] += flrand( -slopFactor, slopFactor );
  23. angs[YAW] += flrand( -slopFactor, slopFactor );
  24. AngleVectors( angs, forward, NULL, NULL );
Advertisement
Add Comment
Please, Sign In to add comment