08-03-2003, 02:47 PM
Ok, I did a lot of code looking the other day when I came with the above two sections... I did continue looking, and I thought it was to do with MaxSpeed. I looked at m_vecHitVelocity:
Then I looked at Normalize:
This would suggest that if flLen is zero that no vector movement occurs. Not sure why, or what that is for, but it does explain why someone only moves back slightly - the 1.
Length is simply:
However, I'm still sure that it has more to do with the Deploy() situation rather than the vectors... but I still can't see what's gonna be causing it.
Quote:disc_weapon_disc.cpp (271):
// Push the player
Vector vecDir = pev->velocity.Normalize();
pOther->pev->flags &= ~FL_ONGROUND;
((CBasePlayer*)pOther)->m_vecHitVelocity = vecDir * DISC_PUSH_MULTIPLIER;
Then I looked at Normalize:
Quote:util_vector.h (95):
inline Vector Normalize(void) const
{
float flLen = Length();
if (flLen == 0) return Vector(0,0,1); // ????
flLen = 1 / flLen;
return Vector(x * flLen, y * flLen, z * flLen);
}
This would suggest that if flLen is zero that no vector movement occurs. Not sure why, or what that is for, but it does explain why someone only moves back slightly - the 1.
Length is simply:
Quote:util_vector.h (92):
inline float Length(void) const { return (float)sqrt(x*x + y*y + z*z); }
However, I'm still sure that it has more to do with the Deploy() situation rather than the vectors... but I still can't see what's gonna be causing it.