From 890d33b39096ee381ed10385fb718dc7fac7ecce Mon Sep 17 00:00:00 2001 From: julianacat Date: Sat, 17 Jun 2017 22:47:15 -0500 Subject: [PATCH] Cleaned up code --- src/gui/ncc/Menu.cpp | 3 --- src/hacks/Aimbot.cpp | 45 ++++++++++++++++++------------------- src/hacks/Aimbot.h | 1 - src/hooks/PaintTraverse.cpp | 1 - 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index c33683b4..0bb33409 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -625,9 +625,6 @@ static const std::string list_tf2 = R"( "log" ] ] -"deboog1" -"deboog2" -"deboog3" )"; List& MainList() { diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 1b37b02d..05a68226 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -676,8 +676,29 @@ EAimbotLocalState ShouldAim() { } void PaintTraverse() { - if (!aimbot_debug) return; if (!enabled) return; + + //Fov ring to represent when a target will be shot + //Not perfect but does a good job of representing where its supposed to be + if (fov_draw) { + //It cant use fovs greater than 180, so we check for that + if ((int)fov < 180 && fov) { + //Dont show ring while player is dead + if (!LOCAL_E->m_bAlivePlayer) { + //Grab the screen resolution and save to some vars + int width, height; + g_IEngine->GetScreenSize(width, height); + //Grab the cvar for fov_desired and attach to another var + static ConVar *realFov = g_ICvar->FindVar("fov_desired"); + //Some math to find radius of the fov circle + float radius = tanf(DEG2RAD((float)fov) / 2) / tanf(DEG2RAD((int)realFov)/ 2) * width; + //Draw a circle with our newfound circle + draw::DrawCircle( width / 2 ,height / 2, radius, 35, GUIColor()); + } + } + } + + if (!aimbot_debug) return; AddSideString(format("AimbotState: ", static_cast(local_state_last))); } @@ -764,28 +785,6 @@ int BestHitbox(CachedEntity* target) { } return -1; } - -void Draw() { - //Fov ring to represent when a target will be shot - //Not perfect but does a good job of representing where its supposed to be - if (fov_draw) { - //It cant use fovs greater than 180, so we check for that - if ((int)fov < 180 && fov) { - //Dont show ring while player is dead - if (!LOCAL_E->m_bAlivePlayer) { - //Grab the screen resolution and save to some vars - int width, height; - g_IEngine->GetScreenSize(width, height); - //Grab the cvar for fov_desired and attach to another var - static ConVar *realFov = g_ICvar->FindVar("fov_desired"); - //Some math to find radius of the fov circle - float radius = tanf(DEG2RAD((float)fov) / 2) / tanf(DEG2RAD((int)realFov)/ 2) * width; - //Draw a circle with our newfound circle - draw::DrawCircle( width / 2 ,height / 2, radius, 35, GUIColor()); - } - } - } -} }}} diff --git a/src/hacks/Aimbot.h b/src/hacks/Aimbot.h index 069d6737..5a070579 100644 --- a/src/hacks/Aimbot.h +++ b/src/hacks/Aimbot.h @@ -92,7 +92,6 @@ bool VischeckPredictedEntity(CachedEntity* entity); void CreateMove(); void PaintTraverse(); void Reset(); -void Draw(); extern EAimbotState state; extern int target_eid; diff --git a/src/hooks/PaintTraverse.cpp b/src/hooks/PaintTraverse.cpp index 244c3b7d..d1763477 100644 --- a/src/hooks/PaintTraverse.cpp +++ b/src/hooks/PaintTraverse.cpp @@ -198,7 +198,6 @@ void PaintTraverse_hook(void* _this, unsigned int vp, bool fr, bool ar) { } { SAFE_CALL(hacks::shared::aimbot::PaintTraverse()); - SAFE_CALL(hacks::shared::aimbot::Draw()); } }