diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 6d7632c3..0054e2c4 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -21,7 +21,9 @@ CatVar stickyspam(CV_SWITCH, "se_stickyspam", "0", "Allows Spam of stickies simply by holding Mouse1."); CatVar cloak(CV_SWITCH, "se_cloak", "0", "Instant decloak/cloak"); CatVar cap(CV_SWITCH, "se_cap", "0", "Auto instant cap"); -CatVar cart(CV_SWITCH, "se_cart", "0", "Automatically farm points by touching the cart (only works on attacking team)"); +CatVar cart(CV_SWITCH, "se_cart", "0", "Automatically farm points by touching " + "the cart (only works on attacking " + "team)"); CatVar instant_weapon_switch(CV_SWITCH, "se_switch", "0", "Instant weapon switch"); CatVar key(CV_KEY, "se_key", "0", "Sequence exploit key"); @@ -33,12 +35,12 @@ CatVar value(CV_INT, "se_value", "900", "Sequence exploit value", CatCommand do_lagexploit("se_do", "Sequence exploit (for use in scripts)", []() { AddExploitTicks(6); }); -int exticks = 0; -const model_t *point = nullptr; -const model_t *point2 = nullptr; -const model_t *point3 = nullptr; -const model_t *point4 = nullptr; -const model_t *point5 = nullptr; +int exticks = 0; +const model_t *point = nullptr; +const model_t *point2 = nullptr; +const model_t *point3 = nullptr; +const model_t *point4 = nullptr; +const model_t *point5 = nullptr; void AddExploitTicks(int ticks) { exticks = std::max(ticks, exticks); @@ -150,9 +152,9 @@ void CreateMove() { if (!point) { - CachedEntity *pEnt = ENTITY(i); + CachedEntity *pEnt = ENTITY(i); if (!CE_GOOD(pEnt)) - continue; + continue; const model_t *model = RAW_ENT(pEnt)->GetModel(); if (!model) continue; @@ -164,7 +166,7 @@ void CreateMove() continue; } if (!point) - continue; + continue; CachedEntity *pEnt = ENTITY(i); if (!CE_GOOD(pEnt)) continue; @@ -197,93 +199,92 @@ void CreateMove() } } if (cart) + { + for (int i = 1; i < HIGHEST_ENTITY; i++) { - for (int i = 1; i < HIGHEST_ENTITY; i++) + if (!point2) { - if (!point2) - { - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/props_trainyard/bomb_cart.mdl", - model_name)) - point2 = model; - } - if (!point3) - { - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/props_2fort/trainwheel001.mdl", - model_name)) - point3 = model; - } - if (!point4) { - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/custom/dirty_bomb_cart.mdl", - model_name)) - point4 = model; - } - if (!point5) - { - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/props_trainyard/bomb_cart_red.mdl", - model_name)) - point5 = model; - } - if (!point2 && !point3 && !point4 && !point5) - continue; CachedEntity *pEnt = ENTITY(i); if (!CE_GOOD(pEnt)) continue; - if (pEnt->m_iTeam == LOCAL_E->m_iTeam) - continue; const model_t *model = RAW_ENT(pEnt)->GetModel(); if (!model) continue; - if (model == point2 || model == point3 || model == point4 || model == point5) + const char *model_name = g_IModelInfo->GetModelName(model); + if (strstr("models/props_trainyard/bomb_cart.mdl", model_name)) + point2 = model; + } + if (!point3) + { + CachedEntity *pEnt = ENTITY(i); + if (!CE_GOOD(pEnt)) + continue; + const model_t *model = RAW_ENT(pEnt)->GetModel(); + if (!model) + continue; + const char *model_name = g_IModelInfo->GetModelName(model); + if (strstr("models/props_2fort/trainwheel001.mdl", model_name)) + point3 = model; + } + if (!point4) + { + CachedEntity *pEnt = ENTITY(i); + if (!CE_GOOD(pEnt)) + continue; + const model_t *model = RAW_ENT(pEnt)->GetModel(); + if (!model) + continue; + const char *model_name = g_IModelInfo->GetModelName(model); + if (strstr("models/custom/dirty_bomb_cart.mdl", model_name)) + point4 = model; + } + if (!point5) + { + CachedEntity *pEnt = ENTITY(i); + if (!CE_GOOD(pEnt)) + continue; + const model_t *model = RAW_ENT(pEnt)->GetModel(); + if (!model) + continue; + const char *model_name = g_IModelInfo->GetModelName(model); + if (strstr("models/props_trainyard/bomb_cart_red.mdl", + model_name)) + point5 = model; + } + if (!point2 && !point3 && !point4 && !point5) + continue; + CachedEntity *pEnt = ENTITY(i); + if (!CE_GOOD(pEnt)) + continue; + if (pEnt->m_iTeam == LOCAL_E->m_iTeam) + continue; + const model_t *model = RAW_ENT(pEnt)->GetModel(); + if (!model) + continue; + if (model == point2 || model == point3 || model == point4 || + model == point5) + { + if (!CE_GOOD(LOCAL_E)) + continue; + ICollideable *c = RAW_ENT(pEnt)->GetCollideable(); + ICollideable *p = RAW_ENT(LOCAL_E)->GetCollideable(); + const Vector &max1 = + p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); + const Vector &min1 = + p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); + const Vector &max2 = + c->OBBMaxs() + pEnt->m_vecOrigin + Vector(25, 25, 25); + const Vector &min2 = + c->OBBMins() + pEnt->m_vecOrigin - Vector(25, 25, 25); + 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)) { - if (!CE_GOOD(LOCAL_E)) - continue; - ICollideable *c = RAW_ENT(pEnt)->GetCollideable(); - ICollideable *p = RAW_ENT(LOCAL_E)->GetCollideable(); - const Vector &max1 = - p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &min1 = - p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &max2 = - c->OBBMaxs() + pEnt->m_vecOrigin + Vector(25, 25, 25); - const Vector &min2 = - c->OBBMins() + pEnt->m_vecOrigin - Vector(25, 25, 25); - 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)) - { - amount = 50; - } + amount = 50; } } } + } if (instant_weapon_switch && not HasCondition(LOCAL_E)) { static int lastweapon = 0; @@ -350,6 +351,11 @@ void CreateMove() { if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFKnife)) { + if ((g_pUserCmd->buttons & IN_ATTACK2) && !bWasHolding && + !HasCondition(LOCAL_E)) + { + amount = 1 * 90; + } if ((g_pUserCmd->buttons & IN_ATTACK) && !bWasHolding && HasCondition(LOCAL_E)) @@ -389,7 +395,6 @@ void CreateMove() } if (!amount) return; - /*g_pUserCmd->command_number += amount; g_pUserCmd->hasbeenpredicted = true; *(int *) ((unsigned) g_IBaseClientState + offsets::lastoutgoingcommand()) += @@ -398,6 +403,7 @@ void CreateMove() int &m_nOutSequenceNr = *(int *) ((unsigned) ch + offsets::m_nOutSequenceNr()); m_nOutSequenceNr += amount; + // bSendPacket = true; } } }