diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 9b5ed2c0..7dda30ec 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -70,7 +70,7 @@ static settings::Float fovcircle_opacity{ "aimbot.fov-circle.opacity", "0.7" }; int GetSentry() { - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) @@ -378,7 +378,7 @@ CachedEntity *RetrieveBestTarget(bool aimkey_state, bool Backtracking) CachedEntity *ent; CachedEntity *target_highest_ent = 0; target_highest_score = -256; - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/hacks/AutoDeadringer.cpp b/src/hacks/AutoDeadringer.cpp index 89460721..167b10e2 100644 --- a/src/hacks/AutoDeadringer.cpp +++ b/src/hacks/AutoDeadringer.cpp @@ -21,7 +21,7 @@ int NearbyEntities() int ret = 0; if (CE_BAD(LOCAL_E) || CE_BAD(LOCAL_W)) return ret; - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) @@ -49,7 +49,7 @@ static void CreateMove() return; if (CE_INT(LOCAL_E, netvar.iHealth) < (int) trigger_health && NearbyEntities() > 1) current_user_cmd->buttons |= IN_ATTACK2; - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/hacks/AutoDetonator.cpp b/src/hacks/AutoDetonator.cpp index 837cf896..96d31463 100644 --- a/src/hacks/AutoDetonator.cpp +++ b/src/hacks/AutoDetonator.cpp @@ -85,7 +85,7 @@ void CreateMove() targets.clear(); // Cycle through the ents and search for valid ents - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { // Assign the for loops tick number to an ent CachedEntity *ent = ENTITY(i); diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp index 71fe094f..a19bdf10 100644 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -198,7 +198,7 @@ int BlastDangerValue(CachedEntity *patient) return 1; } // Find rockets/pipes nearby - for (int i = 32; i < HIGHEST_ENTITY; i++) + for (int i = 32; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) @@ -233,7 +233,7 @@ int NearbyEntities() int ret = 0; if (CE_BAD(LOCAL_E) || CE_BAD(LOCAL_W)) return ret; - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/hacks/AutoReflect.cpp b/src/hacks/AutoReflect.cpp index 8ffaec95..3c7f5095 100644 --- a/src/hacks/AutoReflect.cpp +++ b/src/hacks/AutoReflect.cpp @@ -96,7 +96,7 @@ void CreateMove() float closest_dist = 0.0f; Vector closest_vec; // Loop to find the closest entity - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { // Find an ent from the for loops current tick diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 3590b723..6ee08b90 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -349,7 +349,7 @@ static void cm() { // Try to get a new target auto ent_count = followcart ? HIGHEST_ENTITY : g_IEngine->GetMaxClients(); - for (int i = 1; i < ent_count; i++) + for (int i = 1; i <= ent_count; i++) { auto entity = ENTITY(i); if (CE_INVALID(entity)) // Exist + dormant diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index 83dae162..84af042a 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -377,7 +377,7 @@ void DrawText() //if (TF2C) AddSideString(colors::white, "Crits: %i", s_bCrits); //if (TF2C) AddSideString(colors::white, "CritMult: %i", RemapValClampedNC( CE_INT(LOCAL_E, netvar.iCritMult), 0, 255, 1.0, 6 )); - for (int i = 0; i < HIGHEST_ENTITY; i++) { + for (int i = 0; i <= HIGHEST_ENTITY; i++) { CachedEntity* e = ENTITY(i); if (CE_GOOD(e)) { if (e->m_Type() == EntityType::ENTITY_PROJECTILE) { @@ -456,7 +456,7 @@ void Schema_Reload() CatCommand schema("schema", "Load custom schema", Schema_Reload); CatCommand update_gui_color("gui_color_update", "Update the GUI Color", []() { - hack::command_stack().push("cat set zk.style.tab-button.color.selected.background 446498ff;cat set zk.style.tab-button.color.separator 446498ff;cat set zk.style.tab-button.color.hover.underline 446498ff;cat set zk.style.tab-button.color.selected.underline 446498ff;cat set zk.style.tooltip.border 446498ff;cat set zk.style.box.color.border 446498ff;cat set zk.style.color-preview.color.border 446498ff;cat set zk.style.modal-container.color.border 446498ff;cat set zk.style.tab-selection.color.border 446498ff;cat set zk.style.table.color.border 446498ff;cat set zk.style.checkbox.color.border 446498ff;cat set zk.style.checkbox.color.checked 446498ff;cat set zk.style.checkbox.color.hover 446498ff;cat set zk.style.input.color.border 446498ff;cat set zk.style.input.key.color.border 446498ff;cat set zk.style.input.select.border 446498ff;cat set zk.style.input.slider.color.handle_border 446498ff;cat set zk.style.input.slider.color.bar 446498ff;cat set zk.style.input.text.color.border.active 42BC99ff"); + hack::command_stack().push("cat set zk.style.tab-button.color.selected.background 446498ff;cat set zk.style.tab-button.color.separator 446498ff;cat set zk.style.tab-button.color.hover.underline 446498ff;cat set zk.style.tab-button.color.selected.underline 446498ff;cat set zk.style.tooltip.border 446498ff;cat set zk.style.box.color.border 446498ff;cat set zk.style.color-preview.color.border 446498ff;cat set zk.style.modal-container.color.border 446498ff;cat set zk.style.tab-selection.color.border 446498ff;cat set zk.style.table.color.border 446498ff;cat set zk.style.checkbox.color.border 446498ff;cat set zk.style.checkbox.color.checked 446498ff;cat set zk.style.checkbox.color.hover 00a098ff;cat set zk.style.input.color.border 446498ff;cat set zk.style.input.key.color.border 446498ff;cat set zk.style.input.select.border 446498ff;cat set zk.style.input.slider.color.handle_border 446498ff;cat set zk.style.input.slider.color.bar 446498ff;cat set zk.style.input.text.color.border.active 42BC99ff"); hack::command_stack().push("cat set zk.style.input.text.color.border.inactive 446498ff;cat set zk.style.tree-list-entry.color.lines 42BC99ff;cat set zk.style.task.color.background.hover 446498ff;cat set zk.style.task.color.border 446498ff;cat set zk.style.taskbar.color.border 446498ff;cat set zk.style.window.color.border 446498ff;cat set zk.style.window-close-button.color.border 446498ff;cat set zk.style.window-header.color.background.active 446498ff;cat set zk.style.window-header.color.border.inactive 446498ff;cat set zk.style.window-header.color.border.active 446498ff"); }); @@ -574,7 +574,7 @@ static CatCommand dump_vars_by_name("debug_dump_netvars_name", "Dump netvars of if (args.ArgC() < 1) return; std::string name(args.Arg(1)); - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/hacks/NavBot.cpp b/src/hacks/NavBot.cpp index 6f5db414..d6af8e10 100644 --- a/src/hacks/NavBot.cpp +++ b/src/hacks/NavBot.cpp @@ -449,7 +449,7 @@ static bool getHealthAndAmmo() if (static_cast(LOCAL_E->m_iHealth()) / LOCAL_E->m_iMaxHealth() < 0.64f) { std::vector healthpacks; - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) @@ -480,7 +480,7 @@ static bool getHealthAndAmmo() if (hasLowAmmo()) { std::vector ammopacks; - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index e20028d9..ae94cd4c 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -25,7 +25,7 @@ static settings::Boolean show_teammates{ "radar.show.teammates", "true" }; static settings::Boolean show_healthpacks{ "radar.show.health", "true" }; static settings::Boolean show_ammopacks{ "radar.show.ammo", "true" }; -Timer invalid{}; +static Timer invalid{}; std::pair WorldToRadar(int x, int y) { @@ -76,7 +76,7 @@ void DrawEntity(int x, int y, CachedEntity *ent) rgba_t clr; float healthp = 0.0f; - if (CE_GOOD(ent)) + if (CE_VALID(ent)) { if (ent->m_Type() == ENTITY_PLAYER) { @@ -89,7 +89,9 @@ void DrawEntity(int x, int y, CachedEntity *ent) return; if (clazz <= 0 || clazz > 9) return; - const auto &wtr = WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y); + if (ent->m_vecDormantOrigin() == Vector(0.0f)) + return; + const auto &wtr = WorldToRadar(ent->m_vecDormantOrigin().x, ent->m_vecDormantOrigin().y); if (use_icons) { @@ -116,7 +118,9 @@ void DrawEntity(int x, int y, CachedEntity *ent) { if (ent->m_iClassID() == CL_CLASS(CObjectDispenser) || ent->m_iClassID() == CL_CLASS(CObjectSentrygun) || ent->m_iClassID() == CL_CLASS(CObjectTeleporter)) { - const auto &wtr = WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y); + if (ent->m_vecDormantOrigin() == Vector(0.0f)) + return; + const auto &wtr = WorldToRadar(ent->m_vecDormantOrigin().x, ent->m_vecDormantOrigin().y); tx_teams[CE_INT(ent, netvar.iTeamNum) - 2].draw(x + wtr.first, y + wtr.second, *icon_size * 1.5f, *icon_size * 1.5f, colors::white); switch (ent->m_iClassID()) { @@ -153,16 +157,18 @@ void DrawEntity(int x, int y, CachedEntity *ent) } else if (ent->m_Type() == ENTITY_GENERIC) { + if (ent->m_vecDormantOrigin() == Vector(0.0f)) + return; if (show_healthpacks && (ent->m_ItemType() == ITEM_HEALTH_LARGE || ent->m_ItemType() == ITEM_HEALTH_MEDIUM || ent->m_ItemType() == ITEM_HEALTH_SMALL)) { - const auto &wtr = WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y); + const auto &wtr = WorldToRadar(ent->m_vecDormantOrigin().x, ent->m_vecDormantOrigin().y); float sz = *icon_size * 0.15f * 0.5f; float sz2 = *icon_size * 0.85; tx_items[0].draw(x + wtr.first + sz, y + wtr.second + sz, sz2, sz2, colors::white); } else if (show_ammopacks && (ent->m_ItemType() == ITEM_AMMO_LARGE || ent->m_ItemType() == ITEM_AMMO_MEDIUM || ent->m_ItemType() == ITEM_AMMO_SMALL)) { - const auto &wtr = WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y); + const auto &wtr = WorldToRadar(ent->m_vecDormantOrigin().x, ent->m_vecDormantOrigin().y); float sz = *icon_size * 0.15f * 0.5f; float sz2 = *icon_size * 0.85; tx_items[1].draw(x + wtr.first + sz, y + wtr.second + sz, sz2, sz2, colors::white); @@ -197,10 +203,10 @@ void Draw() if (enemies_over_teammates) enemies.clear(); std::vector sentries; - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { ent = ENTITY(i); - if (CE_BAD(ent)) + if (CE_INVALID(ent)) continue; if (!ent->m_bAlivePlayer()) continue; diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp index 04e792e2..049257d3 100644 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -38,7 +38,7 @@ void Draw() spy_count = 0; if (last_say > g_GlobalVars->curtime) last_say = 0; - for (int i = 0; i < HIGHEST_ENTITY && i < 32; i++) + for (int i = 0; i <= HIGHEST_ENTITY && i < 32; i++) { ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/helpers.cpp b/src/helpers.cpp index 5f740684..6acde8c0 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -1403,7 +1403,7 @@ CatCommand print_classnames("debug_print_classnames", "Lists classnames currentl CachedEntity *ent; // Go through all the entities - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { // Get an entity diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 18209860..af13b13e 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -40,6 +40,7 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd) { if (!ent) return; + typedef void (*SetupMoveFn)(IPrediction *, IClientEntity *, CUserCmd *, class IMoveHelper *, CMoveData *); typedef void (*FinishMoveFn)(IPrediction *, IClientEntity *, CUserCmd *, CMoveData *); diff --git a/src/hoovy.cpp b/src/hoovy.cpp index 336a7325..244aa963 100644 --- a/src/hoovy.cpp +++ b/src/hoovy.cpp @@ -17,7 +17,7 @@ bool HasSandvichOut(CachedEntity *entity) CachedEntity *weapon; weapon_idx = CE_INT(entity, netvar.hActiveWeapon) & 0xFFF; - if (!(weapon_idx > 0 && weapon_idx < HIGHEST_ENTITY)) + if (!(weapon_idx > 0 && weapon_idx <= HIGHEST_ENTITY)) return false; weapon = ENTITY(weapon_idx); if (CE_GOOD(weapon)) diff --git a/src/navparser.cpp b/src/navparser.cpp index aed89f6f..3a9b126f 100644 --- a/src/navparser.cpp +++ b/src/navparser.cpp @@ -127,7 +127,7 @@ class ignoremanager } static void updateDanger() { - for (size_t i = 0; i < HIGHEST_ENTITY; i++) + for (size_t i = 0; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_INVALID(ent)) diff --git a/src/playerresource.cpp b/src/playerresource.cpp index e2cdae4d..859b23f2 100755 --- a/src/playerresource.cpp +++ b/src/playerresource.cpp @@ -14,7 +14,7 @@ void TFPlayerResource::Update() IClientEntity *ent; entity = 0; - for (int i = 0; i < HIGHEST_ENTITY; i++) + for (int i = 0; i <= HIGHEST_ENTITY; i++) { ent = g_IEntityList->GetClientEntity(i); if (ent && ent->GetClientClass()->m_ClassID == RCC_PLAYERRESOURCE) diff --git a/src/projlogging.cpp b/src/projlogging.cpp index 20995b16..70e7bc5a 100644 --- a/src/projlogging.cpp +++ b/src/projlogging.cpp @@ -14,7 +14,7 @@ Vector prevloc[2048]{}; void Update() { - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent)) diff --git a/src/visual/EffectChams.cpp b/src/visual/EffectChams.cpp index 50688c82..07c4cf8c 100644 --- a/src/visual/EffectChams.cpp +++ b/src/visual/EffectChams.cpp @@ -342,7 +342,7 @@ void EffectChams::Render(int x, int y, int w, int h) return; CMatRenderContextPtr ptr(GET_RENDER_CONTEXT); BeginRenderChams(); - for (int i = 1; i < HIGHEST_ENTITY; i++) + for (int i = 1; i <= HIGHEST_ENTITY; i++) { IClientEntity *entity = g_IEntityList->GetClientEntity(i); if (!entity || entity->IsDormant() || CE_BAD(ENTITY(i))) diff --git a/src/visual/imgui/imgui_impl.cpp b/src/visual/imgui/imgui_impl.cpp index 8f5a5ee3..b51d4dd2 100755 --- a/src/visual/imgui/imgui_impl.cpp +++ b/src/visual/imgui/imgui_impl.cpp @@ -1,4 +1,5 @@ +#include #include "visual/imgui/imgui_impl.h" #include "visual/drawing.hpp" #include "visual/imgui/imgui.h" @@ -35,6 +36,7 @@ void ImGui_Impl_Render(ImDrawData *draw_data) glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_TRANSFORM_BIT); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE); glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); diff --git a/src/visual/menu/menu/objects/input/Checkbox.cpp b/src/visual/menu/menu/objects/input/Checkbox.cpp index 3d621990..3bb074db 100644 --- a/src/visual/menu/menu/objects/input/Checkbox.cpp +++ b/src/visual/menu/menu/objects/input/Checkbox.cpp @@ -10,7 +10,7 @@ namespace zerokernel_checkbox static settings::RVariable checkbox_size{ "zk.style.checkbox.size", "12" }; static settings::RVariable color_border{ "zk.style.checkbox.color.border", "446498ff" }; static settings::RVariable color_checked{ "zk.style.checkbox.color.checked", "446498ff" }; -static settings::RVariable color_hover{ "zk.style.checkbox.color.hover", "446498ff77" }; +static settings::RVariable color_hover{ "zk.style.checkbox.color.hover", "00a098ff" }; } // namespace zerokernel_checkbox bool zerokernel::Checkbox::onLeftMouseClick()