diff --git a/CMakeLists.txt b/CMakeLists.txt index 2daecb4d..dd39d83d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,11 +100,16 @@ endif() find_package(Git REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/external") find_package(SDL2 REQUIRED) -# fuck boost -set(BOOST_LIBS_OPTIONAL "" CACHE STRING "Boost libs to be compiled") -add_subdirectory(external/boost-cmake) -set(BOOST_ROOT ${CMAKE_BINARY_DIR}/_deps/boost-src) -find_package(Boost REQUIRED PATHS ${CMAKE_BINARY_DIR}/_deps/boost-src/tools/boost_install/ NO_DEFAULT_PATH) + +# this is necessary for boost to work, change at your peril +find_package(Boost 1.76.5 EXACT) +if (NOT ${Boost_FOUND}) + set(BOOST_LIBS_OPTIONAL "" CACHE STRING "Boost libs to be compiled") + add_subdirectory(external/boost-cmake) + SET (BOOST_ROOT ${CMAKE_BINARY_DIR}/_deps/boost-src) + find_package(Boost 1.76.5 EXACT) + include_directories(${Boost_INCLUDE_DIRS}) +endif() include_directories(${CMAKE_BINARY_DIR}/_deps/boost-src) execute_process(COMMAND diff --git a/TODO b/TODO new file mode 100644 index 00000000..507d0ba7 --- /dev/null +++ b/TODO @@ -0,0 +1,13 @@ +update CGameRules and fix navbot + +fix bot fail during path after respawn in navparser + +fix crashes (i hope BenCat07 will fix it) + +fix EventLogging (crash) + +fix skyboxchanger (not working and crash) + +add zoom and rev distance to cathook (optional) + +fix hitbox update in ESP (crash) i had delete it \ No newline at end of file diff --git a/data/menu/Verdana.ttf b/data/fonts/Verdana.ttf similarity index 100% rename from data/menu/Verdana.ttf rename to data/fonts/Verdana.ttf diff --git a/data/menu/VerdanaBold.ttf b/data/fonts/VerdanaBold.ttf similarity index 100% rename from data/menu/VerdanaBold.ttf rename to data/fonts/VerdanaBold.ttf diff --git a/include/Constants.hpp b/include/Constants.hpp index aa97948c..8bb49033 100644 --- a/include/Constants.hpp +++ b/include/Constants.hpp @@ -11,6 +11,6 @@ constexpr const char *CON_PREFIX = "cat_"; constexpr int MAX_ENTITIES = 2048; -constexpr int MAX_PLAYERS = 32; +constexpr int MAX_PLAYERS = 100; // 0 is "World" but we still can have MAX_PLAYERS players, so consider that constexpr int PLAYER_ARRAY_SIZE = 1 + MAX_PLAYERS; diff --git a/include/helpers.hpp b/include/helpers.hpp index effb9db3..0356f549 100644 --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -143,8 +143,9 @@ bool IsVectorVisible(Vector a, Vector b, bool enviroment_only = false, CachedEnt // A Special function for navparser to check if a Vector is visible. bool IsVectorVisibleNavigation(Vector a, Vector b, unsigned int mask = MASK_SHOT_HULL); float ProjGravMult(int class_id, float x_speed); -bool didProjectileHit(Vector start_point, Vector end_point, CachedEntity *entity, float projectile_size, bool grav_comp, trace_t* tracer = nullptr); +bool didProjectileHit(Vector start_point, Vector end_point, CachedEntity *entity, float projectile_size, bool grav_comp, trace_t *tracer = nullptr); Vector getShootPos(Vector angle); +bool is_rocket(int); Vector GetForwardVector(Vector origin, Vector viewangles, float distance, CachedEntity *punch_entity = nullptr); Vector GetForwardVector(float distance, CachedEntity *punch_entity = nullptr); CachedEntity *getClosestEntity(Vector vec); diff --git a/include/trace.hpp b/include/trace.hpp index 53d418de..5345a45a 100644 --- a/include/trace.hpp +++ b/include/trace.hpp @@ -41,6 +41,19 @@ public: void SetSelf(IClientEntity *self); virtual TraceType_t GetTraceType() const; }; + +class FilterNoTeammates : public ITraceFilter +{ +public: + IClientEntity *m_pSelf; + +public: + virtual ~FilterNoTeammates(); + FilterNoTeammates(); + virtual bool ShouldHitEntity(IHandleEntity *entity, int mask); + void SetSelf(IClientEntity *self); + virtual TraceType_t GetTraceType() const; +}; class FilterNavigation : public ITraceFilter { @@ -84,4 +97,5 @@ extern FilterNoPlayer filter_no_player; extern FilterNavigation filter_navigation; extern FilterNoEntity filter_no_entity; extern FilterPenetration filter_penetration; +extern FilterNoTeammates filter_teammates; } // namespace trace diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 42e253fc..f4fa9456 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -187,14 +187,14 @@ inline float projectileHitboxSize(int projectile_size) case CL_CLASS(CTFPipebombLauncher): case CL_CLASS(CTFGrenadeLauncher): case CL_CLASS(CTFCannon): - return 6.5f; + return 4.0f; case CL_CLASS(CTFFlareGun): case CL_CLASS(CTFFlareGun_Revenge): case CL_CLASS(CTFDRGPomson): - return 3.0f; + return 2.0f; case CL_CLASS(CTFSyringeGun): case CL_CLASS(CTFCompoundBow): - return 2.0f; + return 1.0f; default: return 3.0f; } @@ -1220,6 +1220,16 @@ AimbotTarget_t GetTarget(CachedEntity *entity) } return t; } + +float secant_x(float in) +{ + return 1.0f / (cos(in)); +} +float csc_x(float in) +{ + return 1.0f / (sin(in)); +} + bool Aim(AimbotTarget_t target) { if (*miss_chance > 0 && UniformRandomInt(0, 99) < *miss_chance) @@ -1514,7 +1524,7 @@ int autoHitbox(CachedEntity *target) } // Rockets and stickies should aim at the foot if the target is on the ground - else if (ci == CL_CLASS(CTFPipebombLauncher) || ci == CL_CLASS(CTFRocketLauncher) || ci == CL_CLASS(CTFParticleCannon) || ci == CL_CLASS(CTFRocketLauncher_AirStrike) || ci == CL_CLASS(CTFRocketLauncher_Mortar) || ci == CL_CLASS(CTFRocketLauncher_DirectHit)) + else if (ci == CL_CLASS(CTFPipebombLauncher) || is_rocket(ci)) { bool ground = CE_INT(target, netvar.iFlags) & (1 << 0); if (ground) diff --git a/src/hacks/AutoItem.cpp b/src/hacks/AutoItem.cpp index 51cfa527..9294dffe 100644 --- a/src/hacks/AutoItem.cpp +++ b/src/hacks/AutoItem.cpp @@ -478,8 +478,8 @@ static InitRoutine init( int day = aTime->tm_mday; int month = aTime->tm_mon + 1; // Month is 0 - 11, add 1 to get a jan-dec 1-12 concept - // We only want to Use the christmas noisemaker around christmas time, let's use 12th of december+ til 12th of january - if ((month == 12 && day >= 12) || (month == 1 && day <= 12)) + // We only want to Use the Christmas noisemaker around Christmas time, let's use the 1st of December till 12th of January + if ((month == 12 && day >= 1) || (month == 1 && day <= 12)) noisemaker_id = 673; /* haha operator[] go brrrrrr */ diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 0d068f7f..c9f0c3ff 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -76,13 +76,12 @@ static settings::Boolean proj_enemy{ "esp.projectile.enemy-only", "true" }; static settings::Boolean entity_info{ "esp.debug.entity", "false" }; static settings::Boolean entity_model{ "esp.debug.model", "false" }; static settings::Boolean entity_id{ "esp.debug.id", "true" }; - // Forward declarations class ESPData { public: int string_count{ 0 }; - boost::unordered_flat_map strings{}; + std::vector> strings{}; rgba_t color{ colors::empty }; bool needs_paint{ false }; bool has_collide{ false }; @@ -95,20 +94,10 @@ boost::unordered_flat_map data; inline void AddEntityString(CachedEntity *entity, const std::string &string, const rgba_t &color = colors::empty) { ESPData &entity_data = data[entity->m_IDX]; - if (entity_data.strings.try_emplace(string, color).second) - ++(entity_data.string_count); + entity_data.strings.emplace_back(string, color); + ++(entity_data.string_count); entity_data.needs_paint = true; } -inline bool hitboxUpdate(CachedEntity *ent) -{ - - auto hit = ent->hitboxes.GetHitbox(0); - if (!hit) - return false; - Vector hbm, hbx; - if (!draw::WorldToScreen(hit->min, hbm) || !draw::WorldToScreen(hit->max, hbx)) - return false; -} // Sets an entitys esp color void SetEntityColor(CachedEntity *entity, const rgba_t &color) { @@ -378,7 +367,6 @@ static void cm() // Get an entity from the loop tick and process it ProcessEntity(ent); - hitboxUpdate(ent); ESPData &ent_dat = data.try_emplace(ent->m_IDX, ESPData{}).first->second; if (ent_dat.needs_paint) @@ -407,7 +395,6 @@ static void cm() if (player) { ProcessEntity(ent_index); - hitboxUpdate(ent_index); } else if (entity_tick) ProcessEntity(ent_index); @@ -926,6 +913,8 @@ void ProcessEntityPT() if (ent_data.string_count) DrawStrings(type, transparent, screen, ent_data, ent); } + for (auto &[key, esp_data] : data) + esp_data.strings.clear(); } static std::string write_str; // Used to process entities from CreateMove diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index 5534343c..2b7211f1 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -101,8 +101,13 @@ void DrawEntity(int x, int y, CachedEntity *ent) rgba_t clr; float healthp = 0.0f; + if(CE_VALID(ent)) + { + if (ent->m_Type() == ENTITY_PLAYER) { + if (!ent->m_bAlivePlayer()) + return; if (hide_invis && IsPlayerInvisible(ent)) return; const int &clazz = CE_INT(ent, netvar.iClass); @@ -197,7 +202,7 @@ void DrawEntity(int x, int y, CachedEntity *ent) tx_items[1].draw(x + wtr.first + sz, y + wtr.second + sz, sz2, sz2, colors::white); } } - + } } void Draw() @@ -237,6 +242,8 @@ void Draw() std::vector sentries; for (auto const &ent : entity_cache::valid_ents) { + if (CE_INVALID(ent)) + continue; if (ent->m_iTeam() == 0) continue; if (!ent->m_bAlivePlayer()) diff --git a/src/hacks/Warp.cpp b/src/hacks/Warp.cpp index d1c40ada..453fa1c7 100644 --- a/src/hacks/Warp.cpp +++ b/src/hacks/Warp.cpp @@ -17,6 +17,7 @@ #include "Think.hpp" #include "Aimbot.hpp" #include +#include namespace hacks::tf2::warp { static settings::Boolean enabled{ "warp.enabled", "false" }; @@ -47,7 +48,7 @@ static settings::Boolean warp_left{ "warp.on-hit.left", "true" }; static settings::Boolean warp_right{ "warp.on-hit.right", "true" }; static settings::Boolean debug_seqout{ "debug.warp_seqout", "false" }; -static std::vector> proj_map; +static boost::unordered_flat_map proj_map; // Hidden control rvars for communtiy servers static settings::Int maxusrcmdprocessticks("warp.maxusrcmdprocessticks", "24"); @@ -261,118 +262,163 @@ bool shouldRapidfire() return buttons_pressed; } + void dodgeProj(CachedEntity *proj_ptr) { Vector eav; - + const Vector player_origin = RAW_ENT(LOCAL_E)->GetAbsOrigin(); velocity::EstimateAbsVelocity(RAW_ENT(proj_ptr), eav); // Sometimes EstimateAbsVelocity returns completely BS values (as in 0 for everything on say a rocket) // The ent could also be an in-place sticky which we don't care about - we want to catch it while it's in the air if (1 < eav.Length()) { - Vector proj_pos = RAW_ENT(proj_ptr)->GetAbsOrigin(); - Vector player_pos = RAW_ENT(LOCAL_E)->GetAbsOrigin(); - - float displacement = proj_pos.DistToSqr(player_pos); - float displacement_temp = displacement - 1; - float min_displacement = displacement_temp - 1; - float multipler = 0.01f; + Vector proj_pos = RAW_ENT(proj_ptr)->GetAbsOrigin(); + float multipler = 2.0f; bool add_grav = false; + float high_time = 10; + float low_time = 0; + float high_displacement = std::numeric_limits::max(); float curr_grav = g_ICvar->FindVar("sv_gravity")->GetFloat(); - if (proj_ptr->m_Type() == ENTITY_PROJECTILE) + if (proj_ptr->m_Type() == ENTITY_PROJECTILE && ProjGravMult(proj_ptr->m_iClassID(), eav.Length()) > 0.001f) add_grav = true; // Couldn't find a cleaner way to get the projectiles gravity based on just having a pointer to the projectile itself curr_grav = curr_grav * ProjGravMult(proj_ptr->m_iClassID(), eav.Length()); // Optimization loop. Just checks if the projectile can possibly hit within ~141HU - while (displacement_temp < displacement) + + if (!add_grav) + { + float c_1 = ((float) (player_origin - proj_pos).Dot(eav)) / ((float) eav.Dot(eav)); + // logging::Info("C_1 is %f for the entity id %d, the velocity is %f. The distance is %f", c_1, proj_ptr->m_Type(), eav.Length(), (eav * c_1 + proj_pos).DistTo(player_origin)); + if (c_1 > 0) + { + float dist = (eav * c_1 + proj_pos).DistToSqr(player_origin); + if (dist > 40000) + proj_map.insert({ proj_ptr, Vector(0, 0, 0) }); + else + proj_map.insert({ proj_ptr, eav }); + } + return; + } + float last_displacement = high_displacement; + int sign = 1; + int repeats = 0; + while (high_time > 0.01f) { - Vector temp_pos = (eav * multipler) + proj_pos; - if (add_grav) - temp_pos.z = temp_pos.z - 0.5 * curr_grav * multipler * multipler; - displacement_temp = temp_pos.DistToSqr(player_pos); - if (displacement_temp < min_displacement) - min_displacement = displacement_temp; + Vector temp_pos = (eav * high_time) + proj_pos; + temp_pos.z = temp_pos.z - 0.5 * curr_grav * high_time * high_time; + float curr_disp = temp_pos.DistToSqr(player_origin); + if (curr_disp < high_displacement) + { + repeats = 0; + high_displacement = curr_disp; + high_time -= multipler * sign; + if (multipler > 0.05f) + multipler /= 2.0f; + } + else if (last_displacement < curr_disp) + { + ++repeats; + sign *= -1; + } else - break; - - multipler += 0.01f; + { + repeats = 0; + } + if (repeats > 2) + { + // logging::Info(" entity id %d, the velocity is %f. The distance is %f", proj_ptr->m_Type(), eav.Length(), curr_disp); + proj_map.insert({ proj_ptr, Vector(0, 0, 0) }); + return; + } + last_displacement = curr_disp; + if (high_displacement < 40000) + { + // logging::Info(" entity id %d, the velocity is %f. The distance is %f", proj_ptr->m_Type(), eav.Length(), curr_disp); + proj_map.insert({ proj_ptr, eav }); + return; + } + else + { + // logging::Info(" entity id %d, the velocity is %f. The distance is %f", proj_ptr->m_Type(), eav.Length(), curr_disp); + proj_map.insert({ proj_ptr, Vector(0, 0, 0) }); + return; + } } - if (min_displacement < 20000) - proj_map.emplace_back((std::make_tuple(eav, proj_ptr))); - else - proj_map.emplace_back((std::make_tuple(Vector{ 0, 0, 0 }, proj_ptr))); } } +float hitbox_size_proj(int class_id) +{ + switch (class_id) + { + case CL_CLASS(CTFProjectile_Rocket): + return 4.0f; + case CL_CLASS(CTFGrenadePipebombProjectile): + return 4.0f; + case CL_CLASS(CTFProjectile_Flare): + return 3.0f; + case CL_CLASS(CTFProjectile_EnergyBall): + return 8.0f; + case CL_CLASS(CTFProjectile_GrapplingHook): + case CL_CLASS(CTFProjectile_HealingBolt): + case CL_CLASS(CTFProjectile_Arrow): + return 1.0f; + case CL_CLASS(CTFProjectile_SentryRocket): + return 2.0f; + case CL_CLASS(CTFProjectile_Throwable): + return 4.0f; + } + return 1.0f; +} static void dodgeProj_cm() { if (!LOCAL_E->m_bAlivePlayer() || proj_map.empty() || !dodge_projectile) return; - Vector player_pos = RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const int max_size = proj_map.size(); - for (int i = 0; i < max_size; ++i) + Vector player_pos = RAW_ENT(LOCAL_E)->GetAbsOrigin(); + for (const auto &[proj_ptr, proj_vec] : proj_map) { - auto curr_tuple = proj_map[i]; - Vector key = std::get<0>(curr_tuple); - CachedEntity *val = std::get<1>(curr_tuple); - if (key.Length() < 0.1f) + if (proj_vec.Length() < 0.1f) { - if (CE_GOOD(val)) + if (CE_GOOD(proj_ptr)) continue; else - proj_map.erase((proj_map.begin() + i)); + proj_map.erase(proj_ptr); continue; } - if (CE_GOOD(val)) + if (CE_GOOD(proj_ptr)) { // Since we are sending this warp next tick we need to compensate for fast moving projectiles // 2 Ticks in advance is a fairly safe interval - Vector velocity_comp = key * 2 * TICK_INTERVAL; - velocity_comp.z -= 2 * TICK_INTERVAL * g_ICvar->FindVar("sv_gravity")->GetFloat() * ProjGravMult(val->m_iClassID(), key.Length()); - - Vector proj_next_tik = RAW_ENT(val)->GetAbsOrigin() + velocity_comp; - float diff = proj_next_tik.DistToSqr(player_pos); + float c_1 = ((float) (g_pLocalPlayer->v_Origin - RAW_ENT(proj_ptr)->GetAbsOrigin()).Dot(proj_vec)) / ((float) proj_vec.Dot(proj_vec)); + float ticks = TIME_TO_TICKS(c_1); + if (ticks > 30) + continue; + float max_speed = CE_FLOAT(LOCAL_E, netvar.m_flMaxspeed); + Vector dist = RAW_ENT(proj_ptr)->GetAbsOrigin(); + float proj_hitbox = hitbox_size_proj(proj_ptr->m_iClassID()); // Warp sooner for fast moving projectiles. - if (diff < (15000 * (key.Length() / 1000))) + trace_t trace; + Ray_t ray; + ray.Init(dist, player_pos, Vector(-proj_hitbox, -proj_hitbox, -proj_hitbox), Vector(proj_hitbox, proj_hitbox, proj_hitbox)); + g_ITrace->TraceRay(ray, MASK_SHOT_HULL, NULL, &trace); + if (((IClientEntity *) trace.m_pEnt) == RAW_ENT(LOCAL_E) || trace.DidHit() || trace.endpos.DistToSqr(player_pos) < 1600) { - trace_t trace; - Ray_t ray; - ray.Init(proj_next_tik, player_pos, Vector(0, -8, -8), Vector(0, 8, 8)); - g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_default, &trace); - if (trace.DidHit()) - { + // logging::Info("ENTERED"); + // We need to determine wether the projectile is coming in from the left or right of us so we don't warp into the projectile. + Vector result = GetAimAtAngles(g_pLocalPlayer->v_Eye, RAW_ENT(proj_ptr)->GetAbsOrigin(), LOCAL_E) - g_pLocalPlayer->v_OrigViewangles; - // We need to determine wether the projectile is coming in from the left or right of us so we don't warp into the projectile. - Vector result = GetAimAtAngles(g_pLocalPlayer->v_Eye, RAW_ENT(val)->GetAbsOrigin(), LOCAL_E) - g_pLocalPlayer->v_OrigViewangles; - - if (0 <= result.y) - yaw_amount = -90.0f; - else - yaw_amount = 90.0f; - if ((IClientEntity *) trace.m_pEnt == RAW_ENT(LOCAL_E)) - { - was_hurt = true; - warp_dodge = true; - proj_map.erase((proj_map.begin() + i)); - } - } // It didn't hit anything but it has been proven to be very close to us. Dodge. (This is for the huntsman+pills) + if (0 <= result.y) + yaw_amount = -90.0f; else - { - was_hurt = true; - warp_dodge = true; - Vector result = GetAimAtAngles(g_pLocalPlayer->v_Eye, RAW_ENT(val)->GetAbsOrigin(), LOCAL_E) - g_pLocalPlayer->v_OrigViewangles; - if (0 <= result.y) - yaw_amount = -90.0f; - else - yaw_amount = 90.0f; - - proj_map.erase((proj_map.begin() + i)); - } + yaw_amount = 90.0f; + was_hurt = true; + warp_dodge = true; + proj_map.erase(proj_ptr); } } else - proj_map.erase((proj_map.begin() + i)); + proj_map.erase(proj_ptr); } } // Should we warp? @@ -720,7 +766,7 @@ static void CreateMove() warpLogic(); if ((bool) hacks::tf2::warp::dodge_projectile && CE_GOOD(g_pLocalPlayer->entity)) for (auto const &ent : entity_cache::valid_ents) - if (ent->m_Type() == ENTITY_PROJECTILE && ent->m_bEnemy() && std::find_if(proj_map.begin(), proj_map.end(), [=](const auto &item) { return std::get<1>(item) == ent; }) == proj_map.end()) + if (ent->m_Type() == ENTITY_PROJECTILE && ent->m_bEnemy() && proj_map.find(ent) == proj_map.end()) dodgeProj(ent); // Either in rapidfire, or the tick just after. Either way we need to force bSendPackets in some way. bool should_rapidfire = shouldRapidfire(); @@ -1223,7 +1269,7 @@ static InitRoutine init( EC::Register(EC::CreateMove, CreateMove, "warp_createmove", EC::very_late); EC::Register(EC::CreateMoveWarp, CreateMove, "warp_createmovew", EC::very_late); EC::Register(EC::CreateMove_NoEnginePred, CreateMovePrePredict, "warp_prepredict"); - EC::Register(EC::CreateMove, dodgeProj_cm, "warp_dodgeproj", EC::very_early); + EC::Register(EC::CreateMove, dodgeProj_cm, "warp_dodgeproj", EC::average); EC::Register(EC::CreateMoveEarly, CreateMoveEarly, "warp_createmove_early", EC::very_early); g_IEventManager2->AddListener(&listener, "player_hurt", false); EC::Register( diff --git a/src/helpers.cpp b/src/helpers.cpp index fb879df3..bf6dd416 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -28,7 +28,22 @@ std::vector &RegisteredCommandsList() static std::vector list{}; return list; } +bool is_rocket(int class_id) +{ + switch (class_id) + { + case CL_CLASS(CTFRocketLauncher): + case CL_CLASS(CTFParticleCannon): + case CL_CLASS(CTFRocketLauncher_AirStrike): + case CL_CLASS(CTFRocketLauncher_Mortar): + case CL_CLASS(CTFRocketLauncher_DirectHit): + return true; + default: + return false; + } + return false; +} void BeginConVars() { logging::Info("Begin ConVars"); @@ -40,11 +55,12 @@ void BeginConVars() cfg_autoexec_textmode << "// Put your custom cathook settings in this " "file\n// This script will be executed EACH TIME " "YOU INJECT TEXTMODE CATHOOK\n" - "\n" + "sv_cheats 1\n" "engine_no_focus_sleep 0\n" "hud_fastswitch 1\n" "tf_medigun_autoheal 1\n" - "fps_max 67\n" + "cat_fixvac\n" + "fps_max 30\n" "cat_ipc_connect"; } } @@ -661,7 +677,7 @@ bool didProjectileHit(Vector start_point, Vector end_point, CachedEntity *entity trace_obj = tracer; else trace_obj = new trace_t; - ray.Init(start_point, end_point, Vector(0, -projectile_size, -projectile_size), Vector(0, projectile_size, projectile_size)); + ray.Init(start_point, end_point, Vector(-projectile_size, -projectile_size, -projectile_size), Vector(projectile_size, projectile_size, projectile_size)); g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_default, trace_obj); return (((IClientEntity *) trace_obj->m_pEnt) == RAW_ENT(entity) || (grav_comp ? !trace_obj->DidHit() : false)); } @@ -1880,7 +1896,7 @@ Vector getShootPos(Vector angle) // Huntsman case CL_CLASS(CTFCompoundBow): - vecOffset = Vector(23.5f, 8.0f, -3.0f); + vecOffset = Vector(23.5f, -8.0f, -3.0f); break; default: diff --git a/src/hooks/visual/DrawModelExecute.cpp b/src/hooks/visual/DrawModelExecute.cpp index aaa0d135..8edaeffd 100644 --- a/src/hooks/visual/DrawModelExecute.cpp +++ b/src/hooks/visual/DrawModelExecute.cpp @@ -265,8 +265,7 @@ bool ShouldRenderChams(IClientEntity *entity) CachedEntity *ent = ENTITY(entity->entindex()); if (ent && LOCAL_E && ent->m_IDX == LOCAL_E->m_IDX) return *chamsself; - else - return false; + switch (ent->m_Type()) { case ENTITY_BUILDING: diff --git a/src/ipc.cpp b/src/ipc.cpp index e2c7085b..d11be726 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -362,7 +362,7 @@ void StoreClientData() data.textmode = ENABLE_TEXTMODE; if (g_ISteamUser) { - strncpy(data.name, GetNamestealName(g_ISteamUser->GetSteamID()).c_str(), sizeof(data.name)); + strncpy(data.name, hooked_methods::methods::GetFriendPersonaName(g_ISteamFriends, g_ISteamUser->GetSteamID()), sizeof(data.name)); } } diff --git a/src/navparser.cpp b/src/navparser.cpp index eebf68ec..a0aeeaf0 100644 --- a/src/navparser.cpp +++ b/src/navparser.cpp @@ -35,7 +35,7 @@ static settings::Boolean draw("nav.draw", "false"); static settings::Boolean look{ "nav.look-at-path", "false" }; static settings::Boolean draw_debug_areas("nav.draw.debug-areas", "false"); static settings::Boolean log_pathing{ "nav.log", "false" }; -static settings::Int stuck_time{ "nav.stuck-time", "1000" }; +static settings::Int stuck_time{ "nav.stuck-time", "800" }; static settings::Int vischeck_cache_time{ "nav.vischeck-cache.time", "240" }; static settings::Boolean vischeck_runtime{ "nav.vischeck-runtime.enabled", "true" }; static settings::Int vischeck_time{ "nav.vischeck-runtime.delay", "2000" }; diff --git a/src/nullnexus.cpp b/src/nullnexus.cpp index a97d04a1..ef218a52 100644 --- a/src/nullnexus.cpp +++ b/src/nullnexus.cpp @@ -281,7 +281,7 @@ static InitRoutine init( nexus.connect(*address, *port, *endpoint, true); } - uintptr_t processprint_addr = gSignatures.GetEngineSignature("55 89 E5 57 56 53 83 EC 5C C7 45 ? 00 00 00 00 A1 ? ? ? ? C7 45 ? 00 00 00 00 8B 5D ? 8B 75 ? 85 C0 0F 84 ? ? ? ? 8D 55 ? 89 04 24 89 54 24 ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? 2F 05 00 00"); + uintptr_t processprint_addr = gSignatures.GetEngineSignature("55 89 E5 56 53 83 EC 50 C7 45 ? 00 00 00 00 A1 ? ? ? ? C7 45 ? 00 00 00 00 85 C0 0F 84 ? ? ? ? 8D 55 ? 89 04 24 89 54 24 ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? ? ? ? ? C7 44 24 ? 55 04 00 00"); ProcessPrint_detour_hook.Init(processprint_addr, (void *) ProcessPrint_detour_fn); EC::Register( diff --git a/src/prediction.cpp b/src/prediction.cpp index 861f6c41..d55ddcd2 100644 --- a/src/prediction.cpp +++ b/src/prediction.cpp @@ -319,7 +319,7 @@ void Prediction_PaintTraverse() for (auto const &ent : entity_cache::player_cache) { - + if (CE_BAD(ent) || !ent->m_bAlivePlayer()) continue; @@ -504,11 +504,10 @@ Vector EnginePrediction(CachedEntity *entity, float time, Vector *vecVelocity) } std::pair ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed, float gravity, float entgmod, float proj_startvelocity) { - Vector origin = ent->m_vecOrigin(); + Vector origin = RAW_ENT(ent)->GetAbsOrigin(); Vector velocity; velocity::EstimateAbsVelocity(RAW_ENT(ent), velocity); - Vector hitbox; - GetHitbox(ent, hb, hitbox); + Vector hitbox = ent->hitboxes.GetHitbox(hb)->center; Vector hitbox_offset = hitbox - origin; if (!sv_gravity) @@ -561,7 +560,7 @@ std::pair ProjectilePrediction_Engine(CachedEntity *ent, int hb, // Compensate for ping besttime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) + cl_interp->GetFloat(); bestpos.z += (sv_gravity->GetFloat() / 2.0f * besttime * besttime * gravity); - // S = at^2/2 ; t = sqrt(2S/a)*/ + // S = at^2/2 ; t = sqrt(2S/a)*/ Vector result = bestpos + hitbox_offset; Vector result_initialvel = result; result_initialvel.z -= proj_startvelocity * besttime; @@ -732,9 +731,9 @@ static InitRoutine init( // Don't run if we don't use it if (!hacks::shared::aimbot::engine_projpred && !debug_pp_draw) return; - for (auto const &ent: entity_cache::player_cache) + for (auto const &ent : entity_cache::player_cache) { - + auto &buffer = previous_positions.at(ent->m_IDX - 1); if (CE_BAD(LOCAL_E) || CE_BAD(ent) || !ent->m_bAlivePlayer()) diff --git a/src/trace.cpp b/src/trace.cpp index 72d68532..727037b7 100644 --- a/src/trace.cpp +++ b/src/trace.cpp @@ -279,9 +279,45 @@ void trace::FilterPenetration::Reset() { m_pIgnoreFirst = 0; } +/* Teammate filter */ +trace::FilterNoTeammates::FilterNoTeammates() +{ + m_pSelf = nullptr; +} + +trace::FilterNoTeammates::~FilterNoTeammates(){}; + +void trace::FilterNoTeammates::SetSelf(IClientEntity *self) +{ + if (self == nullptr) + { + logging::Info("nullptr in FilterNoPlayer::SetSelf"); + return; + } + m_pSelf = self; +} + +bool trace::FilterNoTeammates::ShouldHitEntity(IHandleEntity *handle, int mask) +{ + IClientEntity *entity; + ClientClass *clazz; + + if (!handle) + return false; + entity = (IClientEntity *) handle; + if (ENTITY(entity->entindex())->m_iTeam() == ENTITY(m_pSelf->entindex())->m_iTeam()) + return false; + return true; +} + +TraceType_t trace::FilterNoTeammates::GetTraceType() const +{ + return TRACE_EVERYTHING; +} trace::FilterDefault trace::filter_default{}; trace::FilterNoPlayer trace::filter_no_player{}; trace::FilterNavigation trace::filter_navigation{}; trace::FilterNoEntity trace::filter_no_entity{}; trace::FilterPenetration trace::filter_penetration{}; +trace::FilterNoTeammates trace::filter_teammates{}; diff --git a/src/visual/drawing.cpp b/src/visual/drawing.cpp index b12e3c20..6865f745 100644 --- a/src/visual/drawing.cpp +++ b/src/visual/drawing.cpp @@ -175,7 +175,7 @@ static InitRoutine font_size( { #if ENABLE_GLEZ_DRAWING fonts::esp->unload(); - fonts::esp.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), after)); + fonts::esp.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), after)); #else fonts::esp->changeSize(after); #endif @@ -188,7 +188,7 @@ static InitRoutine font_size( { #if ENABLE_GLEZ_DRAWING fonts::center_screen->unload(); - fonts::center_screen.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), after)); + fonts::center_screen.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), after)); #else fonts::center_screen->changeSize(after); #endif @@ -208,17 +208,17 @@ void Initialize() } #if ENABLE_GLEZ_DRAWING glez::preInit(); - fonts::menu.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 10)); - fonts::esp.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 10)); - fonts::center_screen.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 12)); + fonts::menu.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 10)); + fonts::esp.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 10)); + fonts::center_screen.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 12)); #elif ENABLE_ENGINE_DRAWING - fonts::menu.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 10, true)); - fonts::esp.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 10, true)); - fonts::center_screen.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 12, true)); + fonts::menu.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 10, true)); + fonts::esp.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 10, true)); + fonts::center_screen.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 12, true)); #elif ENABLE_IMGUI_DRAWING - fonts::menu.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 13, true)); - fonts::esp.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 13, true)); - fonts::center_screen.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), 14, true)); + fonts::menu.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 13, true)); + fonts::esp.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 13, true)); + fonts::center_screen.reset(new fonts::font(paths::getDataPath("/fonts/Verdana.ttf"), 14, true)); #endif #if ENABLE_ENGINE_DRAWING texture_white = g_ISurface->CreateNewTextureID(); diff --git a/src/visual/menu/menu/Menu.cpp b/src/visual/menu/menu/Menu.cpp index fb5eb74d..7cabc058 100644 --- a/src/visual/menu/menu/Menu.cpp +++ b/src/visual/menu/menu/Menu.cpp @@ -79,11 +79,11 @@ namespace resource::font { // FIXME dynamic font change.. #if ENABLE_IMGUI_DRAWING -fonts::font base{ paths::getDataPath("/menu/Verdana.ttf"), 12 }; -fonts::font bold{ paths::getDataPath("/menu/VerdanaBold.ttf"), 11 }; +fonts::font base{ paths::getDataPath("/fonts/Verdana.ttf"), 12 }; +fonts::font bold{ paths::getDataPath("/fonts/VerdanaBold.ttf"), 11 }; #else -fonts::font base{ paths::getDataPath("/menu/Verdana.ttf"), 10 }; -fonts::font bold{ paths::getDataPath("/menu/VerdanaBold.ttf"), 9 }; +fonts::font base{ paths::getDataPath("/fonts/Verdana.ttf"), 10 }; +fonts::font bold{ paths::getDataPath("/fonts/VerdanaBold.ttf"), 9 }; #endif } // namespace resource::font