View Single Post
Re: Some CS.DLL sources...
Old
  (#5)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Some CS.DLL sources... - 14-01-2013

Code:
void CCSBot::UpdateLookAngles (void)
{
	/// @todo CONTINUE DECOMPILING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	/// @note FROM SOURCE ENGINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

	if (*(_DWORD *)(bot_mimic + 48) != 0)
		return;

	if (IsAttacking ())
	{
		v24 = 300.0f;
		v4 = 30.0f;
	}
	else
	{
		v24 = 200.0f;
		v4 = 25.0f;
	}
	v23 = m_lookAngleYaw;
	v26 = m_lookAnglePitch;
	if (m_currentLadder != NULL && !IsLookingAtSpot (PriorityType_High))
		ComputeLadderAngles ((int)&v23, (int)&v26);
	v5 = EyeAngles ();
	LODWORD(v28) = *(_DWORD *)v5;
	LODWORD(v29) = *(_DWORD *)(v5 + 4);
	v30 = *(_DWORD *)(v5 + 8);
	v7 = AngleNormalize (v23 - v29);
	v8 = 3000.0f;
	if (v7 >= 1.0f || v7 <= -1.0f)
	{
		v9 = v7;
		v10 = -3000.0f;
		v11 = v9 * v24 - m_lookAngleYawUNKNOWN * v4;
		if (v11 > 3000.0f || (v8 = v11, v11 >= -3000.0f))
			v10 = v8;
		v13 = v10 * g_flBotCommandInterval + m_lookAngleYawUNKNOWN;
		m_lookAngleYawUNKNOWN = v13;
		v29 = g_flBotCommandInterval * v13 + v29;
//		if (Math::fabsf (v10) > 1000.0)
//			*(float *)(this + 14340) = CountdownTimer__Now();
	}
	else
	{
		m_lookAngleYawUNKNOWN = 0.0f;
		v29 = v23;
	}
	v15 = AngleNormalize (v26 - v28);
	v16 = v15 * v24 + v15 * v24 - m_lookAnglePitchUNKNOWN * v4;
	if (v16 <= 3000.0f)
	{
		if (v16 < -3000.0f)
			v16 = -3000.0f;
	}
	else
		v16 = 3000.0f;
	v18 = v16 * g_flBotCommandInterval + m_lookAnglePitchUNKNOWN;
	m_lookAnglePitchUNKNOWN = v18;
	v19 = g_flBotCommandInterval * v18 + v28;
	v28 = v19;
	v20 = v19;
	v21 = v16;
	v22 = v20;
	if (Math::fabsf (v21) > 1000.0f)
	{
//		*(float *)(this + 14340) = CountdownTimer__Now();
		v22 = v28;
	}
	if (v22 >= -89.0f)
	{
		if (v22 > 89.0f)
			v28 = 89.0f;
	}
	else
		v28 = -89.0f;
	CBasePlayer__SnapEyeAngles(this, (int)&v28);
//	if (CountdownTimer__Now() <= *(float *)(this + 15580))
//		*(float *)(this + 14340) = CountdownTimer__Now();
}
this looks like how the aiming was done.
IIRC there was a discussion on this one here...
http://forums.bots-united.com/showthread.php?t=3330
  
Reply With Quote