diff --git a/README.md b/README.md index 8ec5fb66..5ebd583f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ You will want to update these files if you wish to have an updated menu. ## Followbots `cathook-ipc-server` allows you to run and control Followbots to do your evil bidding in-game. The installation for Followbots is quite complex, and will not be covered on this page. Obviously, you must have several user accounts ready to run TF2. -A guide for Followbots can be found here: [How to setup followbots.](https://github.com/nullifiedcat/cathook/wiki/Setting-up-Followbots) [How to use followbots.](https://github.com/nullifiedcat/cathook/wiki/Using-Followbots) +A guide for Followbots can be found here: [How to setup and use followbots.](https://www.youtube.com/watch?v=kns5-nw7xUg) You may also ask someone in our discord server to help you out. The installation script is as followed: diff --git a/generate-class-headers.js b/generate-class-headers.js index 55b3509b..71191ab0 100644 --- a/generate-class-headers.js +++ b/generate-class-headers.js @@ -1,14 +1,14 @@ -const fs = require('fs'); +const fs = require("fs"); var full_class_table = {}; try { - full_class_table = JSON.parse(fs.readFileSync('full-class-table.json').toString()); + full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} -const file = fs.readFileSync(process.argv[2]).toString().split('\n'); +const file = fs.readFileSync(process.argv[2]).toString().split("\n"); const modname = process.argv[3]; -console.log('Generating info for', modname, 'from', process.argv[2]); +console.log("Generating info for", modname, "from", process.argv[2]); var classes = {}; for (var i in file) { @@ -19,7 +19,7 @@ for (var i in file) { } } -fs.writeFileSync('full-class-table.json', JSON.stringify(full_class_table)); +fs.writeFileSync("full-class-table.json", JSON.stringify(full_class_table)); var header_constexpr = `/* AUTO-GENERATED HEADER - DO NOT MODIFY @@ -50,10 +50,10 @@ namespace client_classes { `; for (var clz in full_class_table) { - var value = '0'; + var value = "0"; if (classes[clz]) value = classes[clz]; - header_constexpr += '\t\tstatic constexpr int ' + clz + ' = ' + value + ';\n'; - header += '\t\tint ' + clz + ' { ' + value + ' };\n'; + header_constexpr += "\t\tstatic constexpr int " + clz + " = " + value + ";\n"; + header += "\t\tint " + clz + " { " + value + " };\n"; } header += ` @@ -70,8 +70,8 @@ header_constexpr += ` #endif /* $mod_CONSTEXPR_AUTOGEN_HPP */`; -fs.writeFileSync('src/classinfo/' + modname + '.gen.hpp', header.replace(/\$mod/g, modname)); -fs.writeFileSync('src/classinfo/' + modname + '_constexpr.gen.hpp', header_constexpr.replace(/\$mod/g, modname)); +fs.writeFileSync("src/classinfo/" + modname + ".gen.hpp", header.replace(/\$mod/g, modname)); +fs.writeFileSync("src/classinfo/" + modname + "_constexpr.gen.hpp", header_constexpr.replace(/\$mod/g, modname)); -console.log(classes); \ No newline at end of file +console.log(classes); diff --git a/generate-dummy-header.js b/generate-dummy-header.js index d3e7e323..7fe18669 100644 --- a/generate-dummy-header.js +++ b/generate-dummy-header.js @@ -1,11 +1,11 @@ -const fs = require('fs'); +const fs = require("fs"); var full_class_table = {}; try { - full_class_table = JSON.parse(fs.readFileSync('full-class-table.json').toString()); + full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} -console.log('Generating dummy class header'); +console.log("Generating dummy class header"); var header = `/* AUTO-GENERATED HEADER - DO NOT MODIFY @@ -22,7 +22,7 @@ namespace client_classes { `; for (var clz in full_class_table) { - header += '\t\tint ' + clz + ' { 0 };\n'; + header += "\t\tint " + clz + " { 0 };\n"; } header += ` @@ -33,4 +33,4 @@ header += ` #endif /* DUMMY_AUTOGEN_HPP */`; -fs.writeFileSync('src/classinfo/dummy.gen.hpp', header); \ No newline at end of file +fs.writeFileSync("src/classinfo/dummy.gen.hpp", header); diff --git a/generate-dynamic-header.js b/generate-dynamic-header.js index 774f41bf..ba4e377d 100644 --- a/generate-dynamic-header.js +++ b/generate-dynamic-header.js @@ -1,11 +1,11 @@ -const fs = require('fs'); +const fs = require("fs"); var full_class_table = {}; try { - full_class_table = JSON.parse(fs.readFileSync('full-class-table.json').toString()); + full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} -console.log('Generating dummy class header'); +console.log("Generating dummy class header"); var header = `/* AUTO-GENERATED HEADER - DO NOT MODIFY @@ -24,7 +24,7 @@ namespace client_classes { `; for (var clz in full_class_table) { - header += '\t\tint ' + clz + ' { 0 };\n'; + header += "\t\tint " + clz + " { 0 };\n"; } header += ` @@ -35,7 +35,7 @@ header += ` #endif /* DYNAMIC_AUTOGEN_HPP */`; -var POPULATED_MAP = ''; +var POPULATED_MAP = ""; for (var clz in full_class_table) { POPULATED_MAP += `\t\tclassid_mapping["${clz}"] = &${clz};\n`; @@ -69,5 +69,5 @@ dynamic dynamic_list; }`; -fs.writeFileSync('src/classinfo/dynamic.gen.hpp', header); -fs.writeFileSync('src/classinfo/dynamic.gen.cpp', source); \ No newline at end of file +fs.writeFileSync("src/classinfo/dynamic.gen.hpp", header); +fs.writeFileSync("src/classinfo/dynamic.gen.cpp", source); diff --git a/simple-ipc b/simple-ipc index e532876f..94a287d6 160000 --- a/simple-ipc +++ b/simple-ipc @@ -1 +1 @@ -Subproject commit e532876ffd707a48389d54ff904dcc40a84f2839 +Subproject commit 94a287d6faa00d44e1084b04e602842849858443 diff --git a/src/EffectChams.cpp b/src/EffectChams.cpp index 69e73183..c34e7ae8 100644 --- a/src/EffectChams.cpp +++ b/src/EffectChams.cpp @@ -22,7 +22,10 @@ static CatVar ammobox(CV_SWITCH, "chams_ammo", "0", "Ammoboxes", "Render chams o static CatVar buildings(CV_SWITCH, "chams_buildings", "0", "Buildings", "Render chams on buildings"); static CatVar stickies(CV_SWITCH, "chams_stickies", "0", "Stickies", "Render chams on stickybombs"); static CatVar teammate_buildings(CV_SWITCH, "chams_teammate_buildings", "0", "Teammate Buildings", "Render chams on teammates buildings"); -static CatVar weapons(CV_SWITCH, "chams_weapons", "1", "Weapons", "Render chams on players weapons"); +static CatVar recursive(CV_SWITCH, "chams_recursive", "1", "Recursive", "Render chams on weapons and cosmetics"); +static CatVar weapons_white(CV_SWITCH, "chams_weapons_white", "1", "White Weapons", "Should chams on weapons be white"); +static CatVar legit(CV_SWITCH, "chams_legit", "0", "Legit chams", "Don't show chams through walls"); +static CatVar singlepass(CV_SWITCH, "chams_singlepass", "0", "Single-pass", "Render chams only once (this disables 'darker' chams on invisible parts of player"); void EffectChams::Init() { logging::Info("Init EffectChams..."); @@ -102,12 +105,6 @@ bool EffectChams::ShouldRenderChams(IClientEntity* entity) { if (entity->entindex() < 0) return false; CachedEntity* ent = ENTITY(entity->entindex()); if (CE_BAD(ent)) return false; - if (weapons && vfunc(entity, 0xBE, 0)(entity)) { - IClientEntity* owner = vfunc(entity, 0x1C3, 0)(entity); - if (owner) { - return ShouldRenderChams(owner); - } - } switch (ent->m_Type) { case ENTITY_BUILDING: if (!buildings) return false; @@ -141,6 +138,35 @@ bool EffectChams::ShouldRenderChams(IClientEntity* entity) { return false; } +void EffectChams::RenderChamsRecursive(IClientEntity* entity) { + entity->DrawModel(1); + + if (!recursive) return; + + IClientEntity *attach; + int passes = 0; + + attach = g_IEntityList->GetClientEntity(*(int*)((uintptr_t)entity + netvar.m_Collision - 24) & 0xFFF); + while (attach && passes++ < 32) { + if (attach->ShouldDraw()) { + if (entity->GetClientClass()->m_ClassID == RCC_PLAYER && vfunc(attach, 190, 0)(attach)) { + if (weapons_white) { + rgba_t mod_original; + g_IVRenderView->GetColorModulation(mod_original.rgba); + g_IVRenderView->SetColorModulation(colors::white); + attach->DrawModel(1); + g_IVRenderView->SetColorModulation(mod_original.rgba); + } else { + attach->DrawModel(1); + } + } + else + attach->DrawModel(1); + } + attach = g_IEntityList->GetClientEntity(*(int*)((uintptr_t)attach + netvar.m_Collision - 20) & 0xFFF); + } +} + void EffectChams::RenderChams(int idx) { CMatRenderContextPtr ptr(GET_RENDER_CONTEXT); IClientEntity* entity = g_IEntityList->GetClientEntity(idx); @@ -148,17 +174,22 @@ void EffectChams::RenderChams(int idx) { if (ShouldRenderChams(entity)) { rgba_t color = ChamsColor(entity); rgba_t color_2 = color * 0.6f; - mat_unlit_z->AlphaModulate(1.0f); - ptr->DepthRange(0.0f, 0.01f); - g_IVRenderView->SetColorModulation(color); - g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit_z : mat_lit_z); - entity->DrawModel(1); - //((DrawModelExecute_t)(hooks::hkIVModelRender->GetMethod(hooks::offDrawModelExecute)))(_this, state, info, matrix); - mat_unlit->AlphaModulate(1.0f); - g_IVRenderView->SetColorModulation(color_2); - ptr->DepthRange(0.0f, 1.0f); - g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit : mat_lit); - entity->DrawModel(1); + if (!legit) { + mat_unlit_z->AlphaModulate(1.0f); + ptr->DepthRange(0.0f, 0.01f); + g_IVRenderView->SetColorModulation(color_2); + g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit_z : mat_lit_z); + + RenderChamsRecursive(entity); + } + + if (legit || !singlepass) { + mat_unlit->AlphaModulate(1.0f); + g_IVRenderView->SetColorModulation(color); + ptr->DepthRange(0.0f, 1.0f); + g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit : mat_lit); + RenderChamsRecursive(entity); + } } } } diff --git a/src/EffectChams.hpp b/src/EffectChams.hpp index b457c310..a55fa069 100644 --- a/src/EffectChams.hpp +++ b/src/EffectChams.hpp @@ -29,6 +29,7 @@ public: void RenderChams(int idx); void BeginRenderChams(); void EndRenderChams(); + void RenderChamsRecursive(IClientEntity* entity); public: bool init { false }; bool drawing { false }; diff --git a/src/globals.cpp b/src/globals.cpp index 4900541c..f4ad12e3 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -19,6 +19,11 @@ void ThirdpersonCallback(IConVar* var, const char* pOldValue, float flOldValue) } } +ConVar* sv_client_min_interp_ratio; +ConVar* cl_interp_ratio; +ConVar* cl_interp; +ConVar* cl_interpolate; + unsigned long tickcount = 0; char* force_name_newlined = new char[32] { 0 }; bool need_name_change = true; @@ -38,6 +43,11 @@ CatVar disconnect_reason(CV_STRING, "disconnect_reason", "", "Disconnect reason" CatVar event_log(CV_SWITCH, "events", "1", "Advanced Events"); void GlobalSettings::Init() { + sv_client_min_interp_ratio = g_ICvar->FindVar("sv_client_min_interp_ratio"); + cl_interp_ratio = g_ICvar->FindVar("cl_interp_ratio"); + cl_interp = g_ICvar->FindVar("cl_interp"); + cl_interpolate = g_ICvar->FindVar("cl_interpolate"); + bSendPackets = new bool; *bSendPackets = true; force_thirdperson.OnRegister([](CatVar* var) { diff --git a/src/globals.h b/src/globals.h index f56591e1..1615a516 100644 --- a/src/globals.h +++ b/src/globals.h @@ -15,6 +15,11 @@ class CatVar; extern int g_AppID; extern unsigned long tickcount; +extern ConVar* sv_client_min_interp_ratio; +extern ConVar* cl_interp_ratio; +extern ConVar* cl_interp; +extern ConVar* cl_interpolate; + extern CatVar event_log; extern CatVar cathook; // Master switch extern CatVar ignore_taunting; diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index ef90bc0f..d4886f36 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -98,8 +98,11 @@ static CatVar engine_projpred(CV_SWITCH, "debug_aimbot_engine_pp", "0", "Engine static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Spin up minigun if you can see target, useful for followbots"); static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots"); +static CatVar fovcircle_opacity(CV_FLOAT, "aimbot_fov_draw_opacity", "0.7", "FOV Circle Opacity", "Defines opacity of FOV circle", 0.0f, 1.0f); static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets"); +static CatVar miss_chance(CV_FLOAT, "aimbot_miss_chance", "0", "Miss chance", "From 0 to 1. Aimbot will NOT aim in these % cases", 0.0f, 1.0f); + // Current Entity int target_eid { 0 }; CachedEntity* target = 0; @@ -221,6 +224,7 @@ bool ShouldAim() { if (g_pUserCmd->buttons & IN_USE) return false; // Check if using action slot item if (g_pLocalPlayer->using_action_slot_item) return false; + IF_GAME (IsTF2()) { // Check if Carrying A building if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bCarryingObject)) return false; @@ -508,6 +512,12 @@ bool IsTargetStateGood(CachedEntity* entity) { // A function to aim at a specific entitiy void Aim(CachedEntity* entity) { + if (float(miss_chance) > 0.0f) { + if ((rand() % 100) < float(miss_chance) * 100.0f) { + return; + } + } + // Dont aim at a bad entity if (CE_BAD(entity)) return; @@ -969,9 +979,12 @@ void DrawText() { // Broken from kathook merge, TODO needs to be adapted for imgui if (fov_draw) { // It cant use fovs greater than 180, so we check for that - if (fov && float(fov) < 180) { + if (float(fov) > 0.0f && float(fov) < 180) { // Dont show ring while player is dead if (LOCAL_E->m_bAlivePlayer) { + rgba_t color = GUIColor(); + color.a = float(fovcircle_opacity); + // Grab the screen resolution and save to some vars int width, height; g_IEngine->GetScreenSize(width, height); @@ -995,7 +1008,7 @@ void DrawText() { px = width / 2 + radius * cos(ang); py = height / 2 + radius * sin(ang); } - drawgl::Line(px, py, x - px, y - py, GUIColor()); + drawgl::Line(px, py, x - px, y - py, color); px = x; py = y; } diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 09d4409e..e5609064 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -148,26 +148,25 @@ void CreateMove() { } // Infinite healthpacks (I'll probably have to move this somewhere else) - if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth != LOCAL_E->m_iMaxHealth) { + if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth < LOCAL_E->m_iMaxHealth) { ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable(); - const Vector& max1 = p->OBBMaxs(); - const Vector& min1 = p->OBBMins(); + const Vector& max1 = p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); + const Vector& min1 = p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); for (int i = 1; i < entity_cache::max; i++) { CachedEntity* e = ENTITY(i); + if (CE_BAD(e)) continue; if (e->m_iClassID != CL_CLASS(CBaseAnimating)) continue; if (e->m_ItemType != ITEM_HEALTH_SMALL && e->m_ItemType != ITEM_HEALTH_MEDIUM && e->m_ItemType != ITEM_HEALTH_LARGE) continue; - if (e->m_flDistance < 54.0f) amount = 900; - // Not working for some reason? - /*ICollideable* c = RAW_ENT(e)->GetCollideable(); - const Vector& max2 = c->OBBMaxs(); - const Vector& min2 = c->OBBMins(); + ICollideable* c = RAW_ENT(e)->GetCollideable(); + const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin;// + Vector(10, 10, 10); + const Vector& min2 = c->OBBMins() + e->m_vecOrigin;// - Vector(10, 10, 10); if ( (min1.x <= max2.x && max1.x >= min2.x) && (min1.y <= max2.y && max1.y >= min2.y) && (min1.z <= max2.z && max1.z >= min2.z) ) { - logging::Info("Collision with %d", i); + //logging::Info("Collision with %d", i); amount = 900; break; - }*/ + } } } diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index da759281..9ce8d713 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -322,25 +322,19 @@ void CreateMove() { // Check if user settings allow anti-afk if (anti_afk) { - // If the timer exceeds 1 minute, jump and reset the timer - if (g_GlobalVars->curtime - 60 > afkTimeIdle) { - - // Send random commands - g_pUserCmd->sidemove = RandFloatRange(-450.0, 450.0); - g_pUserCmd->forwardmove = RandFloatRange(-450.0, 450.0); - g_pUserCmd->buttons = rand(); + if ( g_GlobalVars->curtime - afkTimeIdle > 60 ) { - // After 1 second we reset the idletime - if (g_GlobalVars->curtime - 61 > afkTimeIdle) { - logging::Info("Finish idle"); - afkTimeIdle = g_GlobalVars->curtime; - } - } else { - // If the player uses a button, reset the timer - if (g_pUserCmd->buttons & IN_FORWARD || g_pUserCmd->buttons & IN_BACK || g_pUserCmd->buttons & IN_MOVELEFT || g_pUserCmd->buttons & IN_MOVERIGHT || g_pUserCmd->buttons & IN_JUMP || !LOCAL_E->m_bAlivePlayer) + // If player didnt jump, then we dont reset the timer + if (CE_INT(g_pLocalPlayer->entity, netvar.movetype) == MOVETYPE_FLY) afkTimeIdle = g_GlobalVars->curtime; + + // Attemt to jump + g_pUserCmd->buttons = g_pUserCmd->buttons &~ IN_JUMP; } + // If the player uses a button, reset the timer + if ( g_pUserCmd->buttons & IN_FORWARD || g_pUserCmd->buttons & IN_BACK || g_pUserCmd->buttons & IN_MOVELEFT || g_pUserCmd->buttons & IN_MOVERIGHT || g_pUserCmd->buttons & IN_JUMP || !LOCAL_E->m_bAlivePlayer ) + afkTimeIdle = g_GlobalVars->curtime; } IF_GAME (IsTF2()) { diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp index 79eb6d63..86b1a7c1 100644 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -35,7 +35,7 @@ void Draw() { closest_spy_distance = 0.0f; spy_count = 0; if (last_say > g_GlobalVars->curtime) last_say = 0; - for (int i = 0; i < HIGHEST_ENTITY && i < 64; i++) { + for (int i = 0; i < HIGHEST_ENTITY && i < 32; i++) { ent = ENTITY(i); if (CE_BAD(ent)) continue; if (CE_BYTE(ent, netvar.iLifeState)) continue; diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index f115b30e..18b5795a 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -27,7 +27,7 @@ static CatVar trigger_key_mode(trigger_key_modes_enum, "trigger_key_mode", "1", static CatEnum hitbox_mode_enum({ "AUTO-HEAD", "AUTO-CLOSEST", "Head only" }); static CatVar hitbox_mode(hitbox_mode_enum, "trigger_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode"); -static CatVar accuracy(CV_INT, "trigger_accuracy", "0", "Improve accuracy", "Improves triggerbot accuracy when aiming for specific hitbox. Recommended to use with sniper rifle/ambassador"); +static CatVar accuracy(CV_INT, "trigger_accuracy", "1", "Improve accuracy", "Improves triggerbot accuracy when aiming for specific hitbox. Recommended to use with sniper rifle/ambassador"); static CatVar ignore_vaccinator(CV_SWITCH, "trigger_ignore_vaccinator", "1", "Ignore Vaccinator", "Hitscan weapons won't fire if enemy is vaccinated against bullets"); static CatVar ignore_hoovy(CV_SWITCH, "trigger_ignore_hoovy", "1", "Ignore Hoovies", "Triggerbot won't attack hoovies"); @@ -42,13 +42,20 @@ static CatVar zoomed_only(CV_SWITCH, "trigger_zoomed", "1", "Zoomed only", "Don' static CatVar max_range(CV_INT, "trigger_maxrange", "0", "Max distance", "Max range for triggerbot\n" "900-1100 range is efficient for scout/widowmaker engineer", 4096.0f); - + +static CatVar delay(CV_FLOAT, "trigger_delay", "0", "Delay", "Triggerbot delay in seconds", 0.0f, 1.0f); + +float target_time = 0.0f; + int last_hb_traced = 0; Vector forward; // The main "loop" of the triggerbot void CreateMove() { + float backup_time = target_time; + target_time = 0; + // Check if aimbot is enabled if (!enabled) return; @@ -65,7 +72,23 @@ void CreateMove() { if (CE_BAD(ent)) return; // Determine whether the triggerbot should shoot, then act accordingly - if (IsTargetStateGood(ent)) g_pUserCmd->buttons |= IN_ATTACK; + if (IsTargetStateGood(ent)) { + target_time = backup_time; + if (delay) { + if (target_time > g_GlobalVars->curtime) { + target_time = 0.0f; + } + if (!target_time) { + target_time = g_GlobalVars->curtime; + } else { + if (g_GlobalVars->curtime - float(delay) >= target_time) { + g_pUserCmd->buttons |= IN_ATTACK; + } + } + } else { + g_pUserCmd->buttons |= IN_ATTACK; + } + } return; } @@ -95,6 +118,11 @@ bool ShouldShoot() { if (HasCondition(g_pLocalPlayer->entity)) return false; // Check if player is cloaked if (IsPlayerInvisible(g_pLocalPlayer->entity)) return false; + + if (IsAmbassador(g_pLocalPlayer->weapon())) { + // Check if ambasador can headshot + if (!AmbassadorCanHeadshot()) return false; + } } IF_GAME (IsTF2()) { diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 94d94b1e..2d922652 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -163,15 +163,19 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { time_replaced = false; curtime_old = g_GlobalVars->curtime; - static ConVar* sv_client_min_interp_ratio = g_ICvar->FindVar("sv_client_min_interp_ratio"); - static ConVar* cl_interp = g_ICvar->FindVar("cl_interp"); - static ConVar* cl_interp_ratio = g_ICvar->FindVar("cl_interp_ratio"); - if (nolerp) { g_pUserCmd->tick_count += 1; - if (sv_client_min_interp_ratio->GetInt() != -1) sv_client_min_interp_ratio->SetValue(-1); - if (cl_interp->GetInt() != 0) cl_interp->SetValue(0); + if (sv_client_min_interp_ratio->GetInt() != -1) { + //sv_client_min_interp_ratio->m_nFlags = 0; + sv_client_min_interp_ratio->SetValue(-1); + } + if (cl_interp->m_fValue != 0) { + cl_interp->SetValue(0); + cl_interp->m_fValue = 0.0f; + cl_interp->m_nValue = 0; + } if (cl_interp_ratio->GetInt() != 0) cl_interp_ratio->SetValue(0); + if (cl_interpolate->GetInt() != 0) cl_interpolate->SetValue(0); } if (!g_Settings.bInvalid && CE_GOOD(g_pLocalPlayer->entity)) { diff --git a/src/hooks/PaintTraverse.h b/src/hooks/PaintTraverse.h index 2c463d4a..ad70f2b0 100644 --- a/src/hooks/PaintTraverse.h +++ b/src/hooks/PaintTraverse.h @@ -12,6 +12,7 @@ class CatVar; extern CatVar no_zoom; extern CatVar clean_screenshots; +extern CatVar disable_visuals; void PaintTraverse_hook(void*, unsigned int, bool, bool); #endif /* PAINTTRAVERSE_H_ */ diff --git a/src/hooks/sdl.cpp b/src/hooks/sdl.cpp index 7c0595ee..5e3e7504 100644 --- a/src/hooks/sdl.cpp +++ b/src/hooks/sdl.cpp @@ -38,7 +38,7 @@ void SDL_GL_SwapWindow_hook(SDL_Window* window) { static SDL_GLContext ctx_tf2 = SDL_GL_GetCurrentContext(); static SDL_GLContext ctx_imgui = nullptr; static SDL_GLContext ctx_text = nullptr; - { + if (!disable_visuals) { PROF_SECTION(DRAW_cheat); if (!ctx_imgui) { ctx_imgui = SDL_GL_CreateContext(window); @@ -55,15 +55,7 @@ void SDL_GL_SwapWindow_hook(SDL_Window* window) { return; } - SDL_GL_MakeCurrent(window, ctx_imgui); - { - PROF_SECTION(DRAW_imgui); - ImGui_ImplSdl_NewFrame(window); - menu::im::Render(); - ImGui::Render(); - } SDL_GL_MakeCurrent(window, ctx_text); - { std::lock_guard draw_lock(drawing_mutex); drawgl::PreRender(); @@ -79,6 +71,13 @@ void SDL_GL_SwapWindow_hook(SDL_Window* window) { drawgl::PostRender(); } + SDL_GL_MakeCurrent(window, ctx_imgui); + { + PROF_SECTION(DRAW_imgui); + ImGui_ImplSdl_NewFrame(window); + menu::im::Render(); + ImGui::Render(); + } } { PROF_SECTION(DRAW_valve); diff --git a/tf-settings/menu.json b/tf-settings/menu.json index 94ac78a4..1791aef7 100644 --- a/tf-settings/menu.json +++ b/tf-settings/menu.json @@ -135,11 +135,12 @@ "type": "list", "name": "Triggerbot Preferences", "list": [ + "trigger_delay", + "trigger_accuracy", "trigger_zoomed", "trigger_maxrange", "trigger_charge", "trigger_hitboxmode", - "trigger_accuracy", "trigger_key_mode", "trigger_key" ] @@ -244,13 +245,16 @@ "name": "Chams", "list": [ "chams_enable", + "chams_legit", + "chams_singlepass", "chams_health", "chams_players", "chams_teammates", "chams_buildings", "chams_teammate_buildings", "chams_flat", - "chams_weapons", + "chams_recursive", + "chams_weapons_white", "chams_medkits", "chams_ammo", "chams_stickies"