Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USE key code
#10
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:

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.
Reply


Messages In This Thread
USE key code - by evil_admin - 07-28-2003, 08:20 PM
USE key code - by Guest - 07-29-2003, 02:32 AM
USE key code - by kermit - 07-29-2003, 06:48 AM
USE key code - by Guest - 07-29-2003, 01:24 PM
USE key code - by GRITS - 07-29-2003, 02:14 PM
USE key code - by Guest - 07-29-2003, 04:09 PM
USE key code - by Guest - 07-29-2003, 04:16 PM
USE key code - by Pique - 08-03-2003, 12:43 PM
USE key code - by evil_admin - 08-03-2003, 01:37 PM
USE key code - by Guest - 08-03-2003, 02:47 PM
USE key code - by kermit - 08-08-2003, 07:57 PM
USE key code - by evil_admin - 08-09-2003, 10:07 AM
USE key code - by evil_admin - 08-09-2003, 01:40 PM
USE key code - by kermit - 08-09-2003, 06:04 PM
USE key code - by evil_admin - 08-09-2003, 06:43 PM
USE key code - by kermit - 08-09-2003, 06:50 PM
USE key code - by evil_admin - 08-09-2003, 10:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)