From 6eb33caa3d75748bc7498b795494339a16631fc6 Mon Sep 17 00:00:00 2001 From: veasman Date: Mon, 14 Jun 2021 18:12:52 -0500 Subject: [PATCH] Fix warnings from unitialized variables --- src/core/features/antiaim.cpp | 16 ++++++++-------- src/core/features/legitbot.cpp | 2 +- src/core/features/ragebot.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/features/antiaim.cpp b/src/core/features/antiaim.cpp index 1b835bb6..d104ca23 100644 --- a/src/core/features/antiaim.cpp +++ b/src/core/features/antiaim.cpp @@ -6,7 +6,7 @@ bool updatingLby() { AnimState* animState = Globals::localPlayer->animState(); float curtime = Globals::localPlayer->tickbase() * Interfaces::globals->interval_per_tick; static float lbyTime; - + if (animState->verticalVelocity > 0.1f || fabs(animState->horizontalVelocity) > 100.0f) { lbyTime = curtime + 0.22f; return false; @@ -29,14 +29,14 @@ void Features::AntiAim::createMove(CUserCmd* cmd) { if (!((cmd->buttons & (1 << 0)) || (cmd->buttons & (1 << 5)))) { if (CONFIGINT("Rage>AntiAim>Type")) { // TODO: for some reason it refuses to desync when looking forward???!?!? - + cmd->viewangles.x = CONFIGINT("Rage>AntiAim>Pitch"); - int real; - int fake; + int real = 0; + int fake = 0; switch (CONFIGINT("Rage>AntiAim>Type")) { - case 1: { // Static + case 1: { // Static real = cmd->viewangles.y + CONFIGINT("Rage>AntiAim>Offset"); fake = CONFIGINT("Rage>AntiAim>Static>Desync"); break; @@ -53,13 +53,13 @@ void Features::AntiAim::createMove(CUserCmd* cmd) { fake = jitterAmt; break; } - case 4: { // Real Jitter + case 4: { // Real Jitter int jitterAmt = (((cmd->tick_count % CONFIGINT("Rage>AntiAim>Real Jitter>Jitter Delay")) < CONFIGINT("Rage>AntiAim>Real Jitter>Jitter Delay") / 2) ? 1 : -1) * (CONFIGINT("Rage>AntiAim>Real Jitter>Jitter Amount") - (CONFIGINT("Rage>AntiAim>Real Jitter>Jitter Amount")/2)); real = cmd->viewangles.y + CONFIGINT("Rage>AntiAim>Offset") + jitterAmt; fake = CONFIGINT("Rage>AntiAim>Static>Desync") - jitterAmt; break; } - case 5: { // Spin + case 5: { // Spin real = cmd->viewangles.y + (cmd->tick_count * CONFIGINT("Rage>AntiAim>Offset")); fake = CONFIGINT("Rage>AntiAim>Spin>Desync"); break; @@ -90,4 +90,4 @@ void Features::AntiAim::createMove(CUserCmd* cmd) { } } } -} \ No newline at end of file +} diff --git a/src/core/features/legitbot.cpp b/src/core/features/legitbot.cpp index 56637ca0..909250c5 100644 --- a/src/core/features/legitbot.cpp +++ b/src/core/features/legitbot.cpp @@ -64,7 +64,7 @@ void Features::LegitBot::createMove(CUserCmd* cmd) { } float closestDelta = FLT_MAX; - QAngle angleToClosestBone; + QAngle angleToClosestBone = QAngle(0, 0, 0); // NOTE: We should really be using returns more, it cleans up // the code a good bit, and makes it easier to understand diff --git a/src/core/features/ragebot.cpp b/src/core/features/ragebot.cpp index 97c409a1..36c1e94d 100644 --- a/src/core/features/ragebot.cpp +++ b/src/core/features/ragebot.cpp @@ -8,7 +8,7 @@ void Features::RageBot::createMove(CUserCmd* cmd) { float FOV = CONFIGINT("Rage>RageBot>Default>FOV")/10.f; float closestDelta = FLT_MAX; - QAngle angleToClosestPlayer; + QAngle angleToClosestPlayer = QAngle(0, 0, 0); // Enumerate over players and get angle to the closest player to crosshair for (int i = 1; i < Interfaces::globals->maxClients; i++) { @@ -19,7 +19,7 @@ void Features::RageBot::createMove(CUserCmd* cmd) { if (p->getAnythingBones(boneMatrix)) { Vector localPlayerEyePos = Globals::localPlayer->eyePos(); Vector targetBonePos = p->getBonePos(8); - + //TODO check which bone would be exposed sooner with engine prediction and which would do more damage. if(CONFIGBOOL("Rage>RageBot>Default>ForceBaim")) { if(p->health() <= CONFIGINT("Rage>RageBot>Default>ForceBaimValue")) {