Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool CLegitBot::AimAtPoint(IClientEntity* pLocal, Vector point, CUserCmd *pCmd)
- {
- if (point.Length() == 0) return false;
- Vector angles;
- Vector src = pLocal->GetOrigin() + pLocal->GetViewOffset();
- CalcAngle(src, point, angles);
- GameUtils::NormaliseViewAngle(angles);
- if (angles[0] != angles[0] || angles[1] != angles[1])
- {
- return false;
- }
- if (RecoilControl > 0)
- {
- Vector AimPunch = pLocal->localPlayerExclusive()->GetAimPunchAngle();
- if (AimPunch.Length2D() > 0 && AimPunch.Length2D() < 150)
- {
- angles -= AimPunch * RecoilControl;
- GameUtils::NormaliseViewAngle(angles);
- }
- }
- IsLocked = true;
- Vector shit = angles - pCmd->viewangles;
- bool v = false;
- GameUtils::NormaliseViewAngle(shit);
- if (shit.Length() > Speed)
- {
- Normalize(shit, shit);
- shit *= Speed;
- }
- else
- {
- v = true;
- }
- pCmd->viewangles += shit;
- Interfaces::Engine->SetViewAngles(pCmd->viewangles);
- return v;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement