diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index cf2663bb..5d6bbd99 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -32,7 +32,7 @@ CatVar value(CV_INT, "se_value", "900", "Sequence exploit value", CatCommand do_lagexploit("se_do", "Sequence exploit (for use in scripts)", []() { AddExploitTicks(6); }); - +AimbotCalculatedData_s calculated_data_array[2048]{}; int exticks = 0; void AddExploitTicks(int ticks) { @@ -59,6 +59,18 @@ static CatVar infinite_packs(CV_SWITCH, "infinite_packs", "0", "Activate sequence exploit when standing on " "pickups while having not full HP/Ammo"); +bool VischeckPredictedEntity(CachedEntity *entity) +{ + // Retrieve predicted data + AimbotCalculatedData_s &cd = calculated_data_array[entity->m_IDX]; + if (cd.vcheck_tick == tickcount) + return cd.visible; + + // Update info + cd.vcheck_tick = tickcount; + cd.visible = IsEntityVectorVisible(entity, entity->m_vecOrigin); + return cd.visible; +} void CreateMove() { if (CE_BAD(LOCAL_E)) @@ -137,12 +149,28 @@ void CreateMove() return; int amount = 0; static bool bWasHolding = false; + static model_t *point = nullptr; bool bIsHolding = ((g_pUserCmd->buttons & IN_ATTACK) || (g_pUserCmd->buttons & IN_ATTACK2)); + if (cap) { for (int i = 1; i < HIGHEST_ENTITY; i++) { + if (!point) + { + CachedEntity *pEnt = ENTITY(i); + const model_t *model = RAW_ENT(pEnt)->GetModel(); + if (!model) + continue; + const char *model_name = g_IModelInfo->GetModelName(model); + if (strstr("models/props_gameplay/cap_point_base.mdl", + model_name)) + point = model; + else + continue; + } + CachedEntity *pEnt = ENTITY(i); if (!CE_GOOD(pEnt)) continue; @@ -151,8 +179,7 @@ void CreateMove() const model_t *model = RAW_ENT(pEnt)->GetModel(); if (!model) continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/props_gameplay/cap_point_base.mdl", model_name)) + if (model == point) { if (!CE_GOOD(LOCAL_E)) continue;