Page 1 of 1

Player Run Command [HL2DM]

Posted: Fri May 20, 2011 8:37 pm
by JoshN0S

Code: Select all

void CHL2_Player::PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper)
{
 // Handle FL_FROZEN.
 if ( m_afPhysicsFlags & PFLAG_ONBARNACLE )
 {
  ucmd->forwardmove = 0;
  ucmd->sidemove = 0;
  ucmd->upmove = 0;
  ucmd->buttons &= ~IN_USE;
 }
 // Can't use stuff while dead
 if ( IsDead() )
 {
  ucmd->buttons &= ~IN_USE;
 }
 //Update our movement information
 if ( ( ucmd->forwardmove != 0 ) || ( ucmd->sidemove != 0 ) || ( ucmd->upmove != 0 ) )
 {
  m_flIdleTime -= TICK_INTERVAL * 2.0f;
  
  if ( m_flIdleTime < 0.0f )
  {
   m_flIdleTime = 0.0f;
  }
  m_flMoveTime += TICK_INTERVAL;
  if ( m_flMoveTime > 4.0f )
  {
   m_flMoveTime = 4.0f;
  }
 }
 else
 {
  m_flIdleTime += TICK_INTERVAL;
  
  if ( m_flIdleTime > 4.0f )
  {
   m_flIdleTime = 4.0f;
  }
  m_flMoveTime -= TICK_INTERVAL * 2.0f;
  
  if ( m_flMoveTime < 0.0f )
  {
   m_flMoveTime = 0.0f;
  }
 }
 //Msg("Player time: [ACTIVE: %f]\t[IDLE: %f]\n", m_flMoveTime, m_flIdleTime );
 BaseClass::PlayerRunCommand( ucmd, moveHelper );
}

Re: Player Run Command [HL2DM]

Posted: Tue Jul 19, 2011 7:51 pm
by killman2639
Since HL2DM uses Source Engine and Source was coded in C++, this thread name should be Player Run Command [C++]

Re: Player Run Command [HL2DM]

Posted: Wed Jul 20, 2011 2:08 am
by Nicdel
Joshua wrote:

Code: Select all

void CHL2_Player::PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper)
{
 // Handle FL_FROZEN.
 if ( m_afPhysicsFlags & PFLAG_ONBARNACLE )
 {
  ucmd->forwardmove = 0;
  ucmd->sidemove = 0;
  ucmd->upmove = 0;
  ucmd->buttons &= ~IN_USE;
 }
 // Can't use stuff while dead
 if ( IsDead() )
 {
  ucmd->buttons &= ~IN_USE;
 }
 //Update our movement information
 if ( ( ucmd->forwardmove != 0 ) || ( ucmd->sidemove != 0 ) || ( ucmd->upmove != 0 ) )
 {
  m_flIdleTime -= TICK_INTERVAL * 2.0f;
  
  if ( m_flIdleTime < 0.0f )
  {
   m_flIdleTime = 0.0f;
  }
  m_flMoveTime += TICK_INTERVAL;
  if ( m_flMoveTime > 4.0f )
  {
   m_flMoveTime = 4.0f;
  }
 }
 else
 {
  m_flIdleTime += TICK_INTERVAL;
  
  if ( m_flIdleTime > 4.0f )
  {
   m_flIdleTime = 4.0f;
  }
  m_flMoveTime -= TICK_INTERVAL * 2.0f;
  
  if ( m_flMoveTime < 0.0f )
  {
   m_flMoveTime = 0.0f;
  }
 }
 //Msg("Player time: [ACTIVE: %f]\t[IDLE: %f]\n", m_flMoveTime, m_flIdleTime );
 BaseClass::PlayerRunCommand( ucmd, moveHelper );
}

Whats the sense of this? Looks like you just copied it from the source file.

Re: Player Run Command [HL2DM]

Posted: Wed Jul 20, 2011 3:48 pm
by Blake
Nicdel wrote:Whats the sense of this? Looks like you just copied it from the source file.
Same thing i was thinking... on another post he made.
http://www.area51cheatserver.com/forums ... =28&t=1671