void CHL2MP_Player::FireBullets ( const FireBulletsInfo_t &info )
{
#ifndef GE_DLL
    // Move other players back to history positions based on local player's lag
    lagcompensation->StartLagCompensation( this, this->GetCurrentCommand() );

    FireBulletsInfo_t modinfo = info;

    CWeaponHL2MPBase *pWeapon = dynamic_cast<CWeaponHL2MPBase *>( GetActiveWeapon() );

    if ( pWeapon )
    {
        modinfo.m_iPlayerDamage = modinfo.m_iDamage = pWeapon->GetHL2MPWpnData().m_iPlayerDamage;
    }

    NoteWeaponFired();

    BaseClass::FireBullets( modinfo );

    // Move other players back to history positions based on local player's lag
    lagcompensation->FinishLagCompensation( this );
#else
    BaseClass::FireBullets( info );
#endif
}
Esempio n. 2
0
//-----------------------------------------------------------------------------
// Purpose: Use correct view model FOV
//-----------------------------------------------------------------------------
float ClientModeHL2MPNormal::GetViewModelFOV()
{
	CWeaponHL2MPBase *pWeapon = dynamic_cast<CWeaponHL2MPBase*>(GetActiveWeapon());
	if (pWeapon)
	{
		return pWeapon->GetViewModelFOV();
	}

	return BaseClass::GetViewModelFOV();
}
	// cin: 070105 - applies existing weapon offsets when
	// entering test mode (this will not be called upon
	// weapon change, so beware)
	// this mode should only be used for calibrating the
	// ironsighted mode offests for a particular weapon
	void ExpWpnTestOffset(ConVar *pConVar, char *pszString)
	{
	   CBasePlayer *pPlayer = UTIL_PlayerByIndex(engine->GetLocalPlayer());
	   if (pPlayer)
	   {
	      CWeaponHL2MPBase *pWeapon  = dynamic_cast<CWeaponHL2MPBase *>(pPlayer->GetActiveWeapon());
	      if (pWeapon)
	      {
	         cl_exp_test_wpn_offset_x.SetValue(pWeapon->GetHL2MPWpnData().m_expOffset.x);
	         cl_exp_test_wpn_offset_y.SetValue(pWeapon->GetHL2MPWpnData().m_expOffset.y);
	         cl_exp_test_wpn_offset_z.SetValue(pWeapon->GetHL2MPWpnData().m_expOffset.z);
	 
	         cl_exp_test_wpn_ori_offset_x.SetValue(pWeapon->GetHL2MPWpnData().m_expOriOffset.x);
	         cl_exp_test_wpn_ori_offset_y.SetValue(pWeapon->GetHL2MPWpnData().m_expOriOffset.y);
	         cl_exp_test_wpn_ori_offset_z.SetValue(pWeapon->GetHL2MPWpnData().m_expOriOffset.z);
	      }
	   }
	}