diff --git a/.vscode/settings.json b/.vscode/settings.json index af303ac..db232ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -65,7 +65,17 @@ "chrono": "cpp", "forward_list": "cpp", "iomanip": "cpp", - "sstream": "cpp" + "sstream": "cpp", + "any": "cpp", + "codecvt": "cpp", + "filesystem": "cpp", + "fstream": "cpp", + "functional": "cpp", + "list": "cpp", + "numeric": "cpp", + "unordered_map": "cpp", + "valarray": "cpp", + "xhash": "cpp" }, "cSpell.words": [ "MOUSEEVENTF", diff --git a/Application/Modules/AimBotModule.h b/Application/Modules/AimBotModule.h index 82e2425..c618f72 100644 --- a/Application/Modules/AimBotModule.h +++ b/Application/Modules/AimBotModule.h @@ -45,6 +45,8 @@ class AimBotModule : public Module Player target; uintptr_t ptrFound = NULL; + float minDistance = NULL; + for (Player &player : ENEMIES) { if (!player.IsValidTarget()) @@ -60,9 +62,13 @@ class AimBotModule : public Module break; } - ptrFound = player.entity; - target = player; - break; + float distance = player.position.EuclideanDistance(MyLocalPlayer.position); + if (!minDistance || distance < minDistance) + { + minDistance = distance; + ptrFound = player.entity; + target = player; + } } if (ptrFound) diff --git a/Application/Modules/Configs.h b/Application/Modules/Configs.h index 8683023..9108f86 100644 --- a/Application/Modules/Configs.h +++ b/Application/Modules/Configs.h @@ -34,6 +34,6 @@ struct EspConfig : public ModuleConfig struct AimConfig : public ModuleConfig { bool isAimActive = false, isClickActive = false, showAimCircle = false; - Circle aimCircle = {.radius = 72, .color = White12, .borderColor = White25}; + Circle aimCircle = {.radius = 128.0F, .color = White12, .borderColor = White25}; float smoothness = 1.5F; }; \ No newline at end of file diff --git a/Engine/Math/vector.h b/Engine/Math/vector.h index 3541bec..7328bbe 100644 --- a/Engine/Math/vector.h +++ b/Engine/Math/vector.h @@ -87,12 +87,22 @@ struct Vector3 * @param other The other vector to calculate the distance to. * @return A Vector3 object containing the distance between the two vectors. */ - Vector3 - Distance(Vector3 other) + Vector3 Distance(Vector3 other) { return {this->x - other.x, this->y - other.y, this->z - other.z}; }; + /** + * Calculates the Euclidean distance between two 3D vectors. + * + * @param other The other vector to calculate the distance to. + * @return The Euclidean distance between the two vectors. + */ + float EuclideanDistance(Vector3 other) + { + return std::sqrt(std::pow(this->x - other.x, 2) + std::pow(this->y - other.y, 2) + std::pow(this->z - other.z, 2)); + } + /** * Calculates the relative angle of a vector in 3D space. * @@ -106,7 +116,8 @@ struct Vector3 * the horizontal plane, the angle in the XY plane, and a fixed 0.0f * for the Z-axis. */ - Vector3 ToAngle(float heightDifference = 0) + Vector3 + ToAngle(float heightDifference = 0) { return { std::atan2(-(z + heightDifference), std::hypot(x, y)) * (180.0f / std::numbers::pi_v),