From 841e7dc2bdf315865c3e7d346c2d7c04a85d6ba7 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Wed, 24 Jan 2018 18:32:23 +0100 Subject: [PATCH 1/2] Fix lagexploit on zoom + add instant weapon switch --- src/hacks/LagExploit.cpp | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 74f2457f..2a9fc24c 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -18,6 +18,8 @@ CatVar toggle(CV_SWITCH, "se_toggle", "0", "Toggle sequence exploit"); CatVar shoot(CV_SWITCH, "se_shoot", "0", "Allows instant revving up or shooting two shots at once"); CatVar cloak(CV_SWITCH, "se_cloak", "0", "Instant decloak/cloak"); +CatVar instant_weapon_switch(CV_SWITCH, "se_switch", "0", + "Instant weapon switch"); CatVar key(CV_KEY, "se_key", "0", "Sequence exploit key"); CatVar master_switch(CV_SWITCH, "se_master", "1", "Enable sequence exploit", "Master switch for the sequence exploit\nDisabling this " @@ -107,7 +109,8 @@ void CreateMove() // TODO: Alternative to - LOCAL_E->m_iAmmo < // LOCAL_E->m_iMaxAmmo That is pseudocode but checking each // weapon for ammo + engie for metal would be ideal - if ((e->m_ItemType == ITEM_AMMO_SMALL || + if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iAmmo) < 5 && + (e->m_ItemType == ITEM_AMMO_SMALL || e->m_ItemType == ITEM_AMMO_MEDIUM || e->m_ItemType == ITEM_AMMO_LARGE)) { @@ -133,6 +136,13 @@ void CreateMove() (g_pUserCmd->buttons & IN_ATTACK2)); if (!LOCAL_E->m_bAlivePlayer) return; + if (instant_weapon_switch && not HasCondition(LOCAL_E)) + { + static int lastweapon = 0; + if (lastweapon != g_pUserCmd->weaponselect) + amount = 1; + lastweapon = g_pUserCmd->weaponselect; + } if (cloak && shoot) { if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFKnife)) @@ -158,12 +168,24 @@ void CreateMove() { if (shoot) { - if (CanShoot() && bIsHolding && !bWasHolding) - amount = 1 * 90; - else if (bWasHolding && !bIsHolding) - amount = 1 * 90; - bWasHolding = (g_pUserCmd->buttons & IN_ATTACK) || - (g_pUserCmd->buttons & IN_ATTACK2); + if (not g_pLocalPlayer->holding_sniper_rifle) + { + if (CanShoot() && bIsHolding && !bWasHolding) + amount = 1 * 90; + else if (bWasHolding && !bIsHolding) + amount = 1 * 90; + bWasHolding = (g_pUserCmd->buttons & IN_ATTACK) || + (g_pUserCmd->buttons & IN_ATTACK2); + } + else + { + bIsHolding = (g_pUserCmd->buttons & IN_ATTACK); + if (CanShoot() && bIsHolding && !bWasHolding) + amount = 1 * 90; + else if (bWasHolding && !bIsHolding) + amount = 1 * 90; + bWasHolding = (g_pUserCmd->buttons & IN_ATTACK); + } } } else if (!shoot) From d7926e6e36751de63aec62d71d0d31635384a7ad Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Wed, 24 Jan 2018 18:44:18 +0100 Subject: [PATCH 2/2] Update LagExploit.cpp --- src/hacks/LagExploit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 2a9fc24c..897b0985 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -140,7 +140,7 @@ void CreateMove() { static int lastweapon = 0; if (lastweapon != g_pUserCmd->weaponselect) - amount = 1; + amount = 1 * 90; lastweapon = g_pUserCmd->weaponselect; } if (cloak && shoot)