Advertisement
Guest User

Untitled

a guest
Nov 8th, 2017
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. bool CLegitBot::AimAtPoint(IClientEntity* pLocal, Vector point, CUserCmd *pCmd)
  2. {
  3. if (point.Length() == 0) return false;
  4.  
  5. Vector angles;
  6. Vector src = pLocal->GetOrigin() + pLocal->GetViewOffset();
  7.  
  8. CalcAngle(src, point, angles);
  9. GameUtils::NormaliseViewAngle(angles);
  10.  
  11. if (angles[0] != angles[0] || angles[1] != angles[1])
  12. {
  13. return false;
  14. }
  15.  
  16. if (RecoilControl > 0)
  17. {
  18. Vector AimPunch = pLocal->localPlayerExclusive()->GetAimPunchAngle();
  19. if (AimPunch.Length2D() > 0 && AimPunch.Length2D() < 150)
  20. {
  21. angles -= AimPunch * RecoilControl;
  22. GameUtils::NormaliseViewAngle(angles);
  23. }
  24. }
  25.  
  26. IsLocked = true;
  27.  
  28. Vector shit = angles - pCmd->viewangles;
  29. bool v = false;
  30. GameUtils::NormaliseViewAngle(shit);
  31. if (shit.Length() > Speed)
  32. {
  33. Normalize(shit, shit);
  34. shit *= Speed;
  35. }
  36. else
  37. {
  38. v = true;
  39. }
  40.  
  41. pCmd->viewangles += shit;
  42. Interfaces::Engine->SetViewAngles(pCmd->viewangles);
  43.  
  44. return v;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement