why doesnt it draw?

Posts 1–7 of 7 · Page 1 of 1
why doesnt it draw?
Code:
void DrawSpread()
	{
		CBaseEntity* localplayer = (CBaseEntity*)Interfaces.EntityList->GetClientEntity(Interfaces.pEngine->GetLocalPlayer());
		if (!localplayer)
			return;

		CBaseCombatWeapon* activeWeapon = (CBaseCombatWeapon*)Interfaces.EntityList->GetClientEntityFromHandle(localplayer->GetActiveBaseCombatWeapon());
		if (!activeWeapon)
			return;

		int width, height;
		Interfaces.Engine->GetScreenSize(width, height);

		if (Settings.GetMenuSetting(Tab_Visuals,Visuals_Spread))
		{
			float cone = activeWeapon->GetInaccuracy();

			if (cone > 0.0f) {
				float radius = (cone * height) / 1.5f;
				Interfaces.Surface->DrawFilledCircle(width / 2, height / 2, radius, 255, 0, 0, 50);
			}
		}
	}
read title
float radius = (cone * height) / 1.5f;
Interfaces.Surface->DrawFilledCircle(width / 2, height / 2, radius, 255, 0, 0, 50);

wtf
how about d e b u g g i n g it, maybe your getinaccuracy returns 0
That's a ghetto method of doing it anyway. Someone posted on another forum the maths behind the correct way.

IDA
Code:
// inside C_WeaponCSBase::DrawCrosshair
 
// this is GetFOV probably
(*(void (**)(void))(*(_DWORD *)v113 + 0x500))();
 
v11 = result * 0.017453292 * 0.5;
v154 = v11;
(*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1936))(v2);
v131 = v11;
(*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1940))(v2);
v133 = v11;
__libm_sse2_tanf((__m128d)LODWORD(v154));
 
// float spread_distance = ( (weapon->GetInaccuracy() + weapon->GetCone()) * 320.f ) / std::tan( Math::deg_to_rad(local_player->GetFOV()) * 0.5f )
v117 = (float)((float)(v133 + v131) * 320.0) / v154;
v137 = (float)((float)(v133 + v131) * 320.0) / v154;
Code:

Code:
float spread_distance = ((localplayer->get_weapon()->get_accuracy() + localplayer->get_weapon()->get_cone()) * 320.f) / std::tan(DEG2RAD(player_fov) * 0.5f);

float radius = spread_distance * (y / 480.f);
Quote Originally Posted by ActualCheats View Post
That's a ghetto method of doing it anyway. Someone posted on another forum the maths behind the correct way.
Code:
float spread_distance = ((localplayer->get_weapon()->get_accuracy() + localplayer->get_weapon()->get_cone()) * 320.f) / std::tan(DEG2RAD(player_fov) * 0.5f);

float radius = spread_distance * (y / 480.f);
y being screen height
Quote Originally Posted by certmemer View Post
y being screen height
Yeah, let's call that anti-pasta.
inb4 this
Code:
void DrawSpread()
	{
		if (Settings.GetMenuSetting(Tab_Visuals,Visuals_Spread))
		{
			float cone = activeWeapon->GetInaccuracy();

			if (cone > 0.0f) {
	(*(void (**)(void))(*(_DWORD *)v113 + 0x500))();
 
v11 = result * 0.017453292 * 0.5;
v154 = v11;
(*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1936))(v2);
v131 = v11;
(*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1940))(v2);
v133 = v11;
__libm_sse2_tanf((__m128d)LODWORD(v154));
 
// float spread_distance = ( (weapon->GetInaccuracy() + weapon->GetCone()) * 320.f ) / std::tan( Math::deg_to_rad(local_player->GetFOV()) * 0.5f )
v117 = (float)((float)(v133 + v131) * 320.0) / v154;
v137 = (float)((float)(v133 + v131) * 320.0) / v154;
			}
		}
	}
Quote Originally Posted by certmemer View Post
inb4 this
Code:
void DrawSpread()
	{
		if (Settings.GetMenuSetting(Tab_Visuals,Visuals_Spread))
		{
			float cone = activeWeapon->GetInaccuracy();

			if (cone > 0.0f) {
	(*(void (**)(void))(*(_DWORD *)v113 + 0x500))();
 
v11 = result * 0.017453292 * 0.5;
v154 = v11;
(*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1936))(v2);
v131 = v11;
(*(void (__thiscall **)(int))(*(_DWORD *)v2 + 1940))(v2);
v133 = v11;
__libm_sse2_tanf((__m128d)LODWORD(v154));
 
// float spread_distance = ( (weapon->GetInaccuracy() + weapon->GetCone()) * 320.f ) / std::tan( Math::deg_to_rad(local_player->GetFOV()) * 0.5f )
v117 = (float)((float)(v133 + v131) * 320.0) / v154;
v137 = (float)((float)(v133 + v131) * 320.0) / v154;
			}
		}
	}
lmao I hope not, that would be some gormless shit.
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us