runplayermove is now not called every frame, the same as main bot code

this gives another fps boost for server perfomance, but gives a little shaky viewmodel (gun) drawing for bot while spectating him in firstperson mode.
This commit is contained in:
jeefo 2015-07-26 13:02:05 +03:00
commit 11d3ffe20e
4 changed files with 11 additions and 5 deletions

View file

@ -3164,8 +3164,11 @@ void Bot::UpdateBodyAngles (void)
void Bot::UpdateLookAngles (void)
{
const float delta = GetWorldTime () - m_lookUpdateTime;
m_lookUpdateTime = GetWorldTime ();
// adjust all body and view angles to face an absolute vector
Vector direction = (m_lookAt - EyePosition ()).ToAngles () + pev->punchangle * (m_difficulty * 25) / 100.0;
Vector direction = (m_lookAt - EyePosition ()).ToAngles ();
direction.x *= -1.0f; // invert for engine
direction.ClampAngles ();
@ -3189,8 +3192,6 @@ void Bot::UpdateLookAngles (void)
float angleDiffYaw = AngleNormalize (direction.y - m_idealAngles.y);
float angleDiffPitch = AngleNormalize (direction.x - m_idealAngles.x);
const float delta = m_frameInterval;
if (angleDiffYaw < 1.0f && angleDiffYaw > -1.0f)
{
m_lookYawVel = 0.0f;