Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Resolver.h"
- #include "..\Aimbot\Aimbot.h"
- #include "..\Aimbot\Autowall.h"
- #include "..\Aimbot\LagComp.h"
- #include "..\..\Utils\Utils.h"
- #include "..\..\SDK\IVEngineClient.h"
- #include "..\..\SDK\Hitboxes.h"
- #include "..\..\SDK\PlayerInfo.h"
- #include "..\..\Utils\Math.h"
- #include "..\..\Menu\Menu.h"
- #include "../../SDK/CEntity.h"
- #include "..\Logs\Logs.h"
- #include "../../SDK/Vector.h"
- Resolver g_Resolver;
- resolver_setup * resolver = new resolver_setup();
- void Resolver::UpdateAnimations(IClientEntity *player, C_BaseEntity* pEnt)
- {
- bool value;
- //Vector vecAbsVelocity;
- auto state = pEnt->GetPlayerAnimationState();
- if (state)
- {
- // backup
- const float curtime = g_pGlobalVars->curtime;
- const float frametime = g_pGlobalVars->frametime;
- g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick;
- g_pGlobalVars->curtime = pEnt->GetSimulationTime();
- int backup_eflags = pEnt->m_iEFlags();
- // animstate->m_iLastClientSideAnimationUpdateFramecount - animstate->m_flLastClientSideAnimationUpdateTime
- // SetLocalVelocity
- pEnt->m_iEFlags() &= ~0x1000; // InvalidatePhysicsRecursive(VELOCITY_CHANGED); EFL_DIRTY_ABSVELOCITY = 0x1000
- // pEnt->SetAbsVelocity() = pEnt->m_vecVelocity();
- // invalidates prior animations
- //if (state->m_iLastClientSideAnimationUpdateFramecount() == g_pGlobalVars->framecount)
- // state->m_iLastClientSideAnimationUpdateFramecount() = g_pGlobalVars->framecount - 1;
- //pEnt->ClientAnimations(value) = true;
- // updates local animations + poses + calculates new abs angle based on eyeangles and other stuff
- pEnt->UpdateClientAnimation();
- pEnt->ClientAnimations() = false;
- // restore
- pEnt->m_iEFlags() = backup_eflags;
- g_pGlobalVars->curtime = curtime;
- g_pGlobalVars->frametime = frametime;
- pEnt->InvalidateBoneCache();
- player->SetupBones(nullptr, -1, 0x7FF00, g_pGlobalVars->curtime);
- }
- }
- void Resolver::AnimationFix2(C_BaseEntity* pEnt, C_BaseEntity* pLocalEnt)
- {
- /*static float ShotTime[65];
- static float oldSimtime[65];
- static float storedSimtime[65];
- static Vector oldEyeAngles[65];
- static float oldGoalfeetYaw[65];
- static Vector oldOrigin[65]; */
- auto AnimState = pEnt->AnimState();
- auto local_player = g::pLocalEntity;
- if (pEnt == local_player) {
- pEnt->ClientAnimations() = true;
- auto player_animation_state = pEnt->AnimState();
- AnimState->m_flLeanAmount = 15;
- AnimState->m_flCurrentTorsoYaw += 10;
- pEnt->UpdateClientAnimation();
- pEnt->SetAbsAngles(Vector(0, AnimState->m_flGoalFeetYaw, 0));
- pEnt->ClientAnimations() = false;
- }
- else {
- auto player_index = pEnt->EntIndex() - 1;
- pEnt->ClientAnimations() = true;
- auto old_curtime = g_pGlobalVars->curtime;
- auto old_frametime = g_pGlobalVars->frametime;
- g_pGlobalVars->curtime = pEnt->GetSimulationTime();
- g_pGlobalVars->frametime = g_pGlobalVars->intervalPerTick;
- auto player_model_time = reinterpret_cast<int*>(AnimState + 120);
- if (AnimState != nullptr && player_model_time != nullptr)
- if (*player_model_time == g_pGlobalVars->framecount)
- * player_model_time = g_pGlobalVars->framecount - 1;
- pEnt->UpdateClientAnimation();
- g_pGlobalVars->curtime = old_curtime;
- g_pGlobalVars->frametime = old_frametime;
- //pEnt->SetAbsAngles(Vector(0, player_animation_state->m_flGoalFeetYaw, 0));
- pEnt->ClientAnimations() = false;
- ;
- /*if (g::missedshoted > 3)
- {
- float angToLocal = g_Math.NormalizeYaw(g_Math.CalcAngle(pLocalEnt->GetOrigin(), pEnt->GetOrigin()).y);
- float Back = g_Math.NormalizeYaw(angToLocal);
- float DesyncFix = 0;
- float* PosParams = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(pEnt) + 0x2774);
- bool shot = false;
- float Resim = g_Math.NormalizeYaw((TICKS_TO_TIME(16) / (pEnt->GetSimulationTime() - oldSimtime[pEnt->EntIndex()])) * g_Math.NormalizeYaw(oldEyeAngles[pEnt->EntIndex()].y - pEnt->GetEyeAngles().y));
- if (Resim > 60.f)
- Resim = 60.f;
- if (Resim < -60.f)
- Resim = -60.f;
- if (g_Menu.Config.Resolver && !shot && !isnan(angToLocal) && !isinf(angToLocal) && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam())
- {
- float AntiSide = 0.f;
- if (g::MissedShots[pEnt->EntIndex()] % 2)
- {
- if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Back) > 0.f)
- AntiSide = -90.f;
- else if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Back) < 0.f)
- AntiSide = 90.f;
- }
- else
- {
- if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - g_Math.NormalizeYaw(Back + 90)) > 0.f)
- AntiSide = 180.f;
- else if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - g_Math.NormalizeYaw(Back + 90)) < 0.f)
- AntiSide = 0.f;
- }
- float Brute = g_Math.NormalizeYaw(Back + AntiSide);
- float Delta = g_Math.NormalizeYaw(g_Math.NormalizeYaw(Brute - pEnt->GetEyeAngles().y) + Resim);
- if (Delta > 58.f) // who needs clamps
- Delta = 58.f;
- if (Delta < -58.f)
- Delta = -58.f;
- Resim += Delta;
- DesyncFix += Delta;
- if (Resim > 60.f)
- Resim = 60.f;
- if (Resim < -60.f)
- Resim = -60.f;
- }
- float Equalized;
- // if (fabs(g_Math.NormalizeYaw(oldEyeAngles[pEnt->EntIndex()].y - pEnt->GetEyeAngles().y)) < 60.f) // yea basically im retarded
- Equalized = g_Math.NormalizeYaw(pEnt->GetEyeAngles().y + Resim);
- // else
- // Equalized = g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Resim);
- if (g_Menu.Config.Resolver && !shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && (pEnt->GetFlags() & FL_ONGROUND))
- AnimState->m_flGoalFeetYaw = Equalized;
- } //b resolver?
- float* PosParams = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(pEnt) + 0x2774);
- bool shot = false; */
- float* PosParams = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(pEnt) + 0x2774);
- bool shot = false;
- if (shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && PosParams[12] <= -80) // ez shot pitch fix LMAO
- PosParams[12] = 89.f;
- }
- }
- void Resolver::AnimationFix(C_BaseEntity* pEnt, C_BaseEntity* pLocalEnt)
- {
- // i rly am just to lazy pls dont judge
- static float ShotTime[65];
- static float oldSimtime[65];
- static float storedSimtime[65];
- static Vector oldEyeAngles[65];
- static float oldGoalfeetYaw[65];
- static Vector oldOrigin[65];
- float* PosParams = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(pEnt) + 0x2774);
- bool shot = false;
- auto* AnimState = pEnt->AnimState();
- if (!AnimState || !pEnt->AnimOverlays() || !PosParams)
- return;
- if (*reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(AnimState) + 0x164) < 0) // sorry had to anti pasta this basically the key to nospread
- * reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(AnimState) + 0x110) = 0.f;
- bool update = false;
- if (storedSimtime[pEnt->EntIndex()] != pEnt->GetSimulationTime())
- {
- pEnt->ClientAnimations() = true;
- pEnt->UpdateClientAnimation();
- // pEnt->ClientAnimations() = false;
- update = true;
- }
- oldGoalfeetYaw[pEnt->EntIndex()] = AnimState->m_flGoalFeetYaw;
- if (pEnt->GetActiveWeapon() && !pEnt->IsKnifeorNade())
- {
- if (ShotTime[pEnt->EntIndex()] != pEnt->GetActiveWeapon()->GetLastShotTime())
- {
- shot = true;
- ShotTime[pEnt->EntIndex()] = pEnt->GetActiveWeapon()->GetLastShotTime();
- }
- else
- shot = false;
- }
- else
- {
- shot = false;
- ShotTime[pEnt->EntIndex()] = 0.f;
- }
- if (shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && PosParams[12] <= -80) // ez shot pitch fix LMAO
- PosParams[12] = 89.f;
- if (update)
- {
- oldEyeAngles[pEnt->EntIndex()] = pEnt->GetEyeAngles();
- oldSimtime[pEnt->EntIndex()] = storedSimtime[pEnt->EntIndex()];
- storedSimtime[pEnt->EntIndex()] = pEnt->GetSimulationTime();
- oldOrigin[pEnt->EntIndex()] = pEnt->GetOrigin();
- }
- pEnt->SetAbsAngles(Vector(0, oldGoalfeetYaw[pEnt->EntIndex()], 0));
- }
- void StaticDesyncResolve(C_BaseEntity* entity)
- {
- int angle1[64];
- int angle2[64];
- int angle3[64];
- static float old_simtime[65];
- bool using_fake_angles[65];
- if (old_simtime[entity->EntIndex()] != entity->GetSimulationTime())
- angle1[entity->EntIndex()] = entity->GetEyeAngles().y;
- else
- angle2[entity->EntIndex()] = entity->GetEyeAngles().y;
- if (angle1[entity->EntIndex()] != angle2[entity->EntIndex()])
- using_fake_angles[entity->EntIndex()] = true;
- else
- using_fake_angles[entity->EntIndex()] = false;
- if (using_fake_angles[entity->EntIndex()])
- {
- if (g_Math.YawDistance(angle1[entity->EntIndex()], angle2[entity->EntIndex()]) <= 58)
- {
- entity->GetEyeAnglesPointer()->y = entity->GetLowerBodyYaw() - g_Math.YawDistance(angle1[entity->EntIndex()], angle2[entity->EntIndex()]);
- }
- }
- old_simtime[entity->EntIndex()] = entity->GetSimulationTime();
- }
- void Guess(C_BaseEntity* ent)
- {
- // 0,1,2 not 1,2,3. someone doesn't know how '%' works, eh? -swoopae
- switch (g::MissedShots[ent->EntIndex()] % 3)
- {
- case 0:
- StaticDesyncResolve(ent); break;
- case 1:
- ent->GetEyeAnglesPointer()->y += ent->GetMaxDesyncDelta(); break;
- case 2:
- ent->GetEyeAnglesPointer()->y -= ent->GetMaxDesyncDelta(); break;
- }
- }
- void Resolver::resolvepitch(C_BaseEntity* pEnt)
- {
- auto local_player = g::pLocalEntity;
- float last_simtime[64] = { 0.f };
- float stored_pitch_1[64] = { 0.f };
- float fixed_pitch[64] = { 0.f };
- float yaw = pEnt->GetEyeAngles().y;
- bool has_been_set[64] = { false };
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(0);
- //const auto local = hackManager.pLocal();
- if (!local_player)
- return;
- for (auto i = 0; i < g_pEngine->GetMaxClients(); ++i)
- {
- const auto eye = pEnt->GetEyeAngles().y;
- auto pitch = 0.f;
- if (eye > 89.f)
- pitch = 89.f;
- else if (eye < -89.f)
- pitch = -89.f;
- else
- {
- if (stored_pitch_1[i] == FLT_MAX || !has_been_set[i])
- {
- stored_pitch_1[i] = eye;
- has_been_set[i] = true;
- }
- if (stored_pitch_1[i] - eye < 30 && stored_pitch_1[i] - eye > -30)
- {
- pitch = eye;
- }
- else
- {
- pitch = stored_pitch_1[i];
- }
- }
- // pPlayerEntity->SetEyeAngles(Vector(pPlayerEntity->GetEyeAngles().x,
- //pPlayerEntity->(Vector(GetEyeAngles().x = pitch;
- }
- }
- void brutev2(int stage, IClientEntity * player, float yaw_value, C_BaseEntity* pEnt)
- {
- switch (stage)
- {
- case 0: // no delta check / low jitter
- {
- switch (g::MissedShots[pEnt->EntIndex()] % 3)
- {
- case 0: pEnt->GetEyeAnglesXY()->y -= -yaw_value;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y += -yaw_value;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y -= 45.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y += 45.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value - 90.f;
- break;
- }
- }
- break;
- case 1: // low delta break / limited jitter
- {
- switch (g::MissedShots[pEnt->EntIndex()] % 3)
- {
- case 0: pEnt->GetEyeAnglesXY()->y += 20.f;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y += 45.f;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y -= 20.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y -= 45.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value;
- break;
- default: pEnt->GetEyeAnglesXY()->y -= pEnt->GetLowerBodyYaw() - pEnt->GetEyeAnglesXY()->y;
- }
- }
- break;
- case 2: // high delta break / high jitter
- {
- switch (g::MissedShots[pEnt->EntIndex()] % 4)
- {
- case 0: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - 40.f;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() + 40.f;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - 90.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y = yaw_value - 29.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value + 29.f;
- break;
- }
- }
- }
- }
- float NormalizeYaw180(float yaw)
- {
- if (yaw > 180)
- yaw -= (round(yaw / 360) * 360.f);
- else if (yaw < -180)
- yaw += (round(yaw / 360) * -360.f);
- return yaw;
- }
- void Resolver::ResolverB(C_BaseEntity* pEnt, IClientEntity* player)
- {
- auto AnimState = pEnt->AnimState();
- float speedfraction = 0.0;
- if (AnimState->m_flFeetSpeedForwardsOrSideWays < 0.0)
- speedfraction = 0.0;
- else
- speedfraction = AnimState->m_flFeetSpeedForwardsOrSideWays;
- float v2 = (AnimState->m_flStopToFullRunningFraction * -0.30000001 - 0.19999999) * speedfraction;
- float v18 = v2;
- float v3 = v2 + 1.0;
- float v23 = v3;
- float original_lby[65] = { FLT_MAX };
- auto fix_goal_feet_yaw = [](float rotation, float invertedrotation, float yawfeetdelta, float yaw, C_AnimState* state) {
- if (yawfeetdelta < rotation) {
- if (invertedrotation > yawfeetdelta)
- * (float*)(uintptr_t(state) + 0x80) = invertedrotation + yaw;
- }
- else
- *(float*)(uintptr_t(state) + 0x80) = yaw - rotation;
- };
- auto get_rotation = [&](int rotation_type, C_AnimState* state) {
- float v43 = *(float*)((uintptr_t)state + 0xA4);
- float v54 = max(0, min(*reinterpret_cast<float*>((uintptr_t)state + 0xF8), 1));
- float v55 = max(0, min(1, *reinterpret_cast<float*>((uintptr_t)state + 0xFC)));
- float v56;
- v56 = ((*reinterpret_cast<float*>((uintptr_t)state + 0x11C) * -0.30000001) - 0.19999999) * v54;
- if (v43 > 0)
- v56 += ((v43 * v55) * (0.5 - v56));
- v56 = *(float*)((uintptr_t)state + rotation_type) * v56;
- return v56;
- };
- auto state = pEnt->GetPlayerAnimationState();
- //auto AnimState = pEnt->AnimState();
- auto local_player = g::pLocalEntity;
- // auto animstate1 = pEnt->AnimState();
- if (!AnimState)
- return;
- /* float newFeetYaw =
- 1.f;
- auto eyeYaw = AnimState->m_flEyeYaw;
- auto lbyYaw = AnimState->m_flGoalFeetYaw;
- float eye_feet_delta = fabs(eyeYaw - lbyYaw);
- float flMaxYawModifier = AnimState->pad10[516] * flMaxYawModifier;
- float flMinYawModifier = AnimState->pad10[512] * flMaxYawModifier;
- auto v28 = 0.f;
- if (AnimState->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
- {
- v28 = fminf(AnimState->m_flFeetSpeedForwardsOrSideWays, 0.0f);
- }
- else
- {
- v28 = 0x3F800000;
- }
- float v49 = ((AnimState->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v49;
- if (eye_feet_delta <= flMaxYawModifier)
- {
- if (flMinYawModifier > eye_feet_delta)
- {
- newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
- }
- }
- else
- {
- newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
- }*/
- /*float v136 = fmod(newFeetYaw, 360.0);
- if (v136 > 180.0)
- {
- v136 = v136 - 360.0;
- }
- if (v136 < 180.0)
- {
- v136 = v136 + 360.0;
- }
- v28 = v49++; */
- float feet_eye = NormalizeYaw180(state->m_flGoalFeetYaw - pEnt->GetEyeAngles().y);
- float inverted = get_rotation(0x2B4, AnimState);
- float max = get_rotation(0x2B0, AnimState);
- float yawfeetdelta = AnimState->m_flEyeYaw - AnimState->m_flGoalFeetYaw;
- float yaw = pEnt->GetEyeAngles().y;
- if (pEnt != g::pLocalEntity && (pEnt->GetTeam() != g::pLocalEntity->GetTeam() && !g_Menu.Config.FriendlyFire) && g_Menu.Config.Resolver2 /*&& !( GetAsyncKeyState( g_Menu.Config.override_resolver_key ) && g_Menu.Config.ResolverOverride && g::pLocalEntity && g::pLocalEntity->IsAlive())*/ || pEnt != g::pLocalEntity && g_Menu.Config.FriendlyFire && g_Menu.Config.Resolver /*&& !( GetAsyncKeyState( g_Menu.Config.override_resolver_key ) && g_Menu.Config.ResolverOverride && g::pLocalEntity && g::pLocalEntity->IsAlive())*/) {
- // if (!g::MissedShots[pEnt->EntIndex()]) {
- if (local_player)
- {
- for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
- {
- //player = GetClientEntity(g_EntityList, i);
- if (local_player->IsDormant())// dormant
- {
- // auto v29 = AnimState->m_flEyeYaw == 0.0 ? -60 : 60;
- // if (v29)
- // return;
- auto v28 = AnimState->m_flEyeYaw == 0.0 ? -58 : 58; // 58
- if (v28)
- return;
- auto v27 = AnimState->m_flEyeYaw == 0.0 ? -90 : 90; // 89
- if (v27)
- return;
- auto v26 = AnimState->m_flEyeYaw == 0.0 ? -79 : 79; // 79
- if (v26)
- return;
- auto v25 = AnimState->m_flEyeYaw == 0.0 ? -118 : 118; // 125 // 60
- if (v25)
- return;
- auto v24 = AnimState->m_flEyeYaw == 0.0 ? -60 : 60; // 78
- if (v24)
- return;
- }
- float v8 = 0;
- float v7 = 0;
- float v6 = 0;
- for (size_t i = 0; i < g::pLocalEntity->GetNumAnimOverlays(); i++)
- {
- auto layer = g::pLocalEntity->get_anim_overlay_index(i);
- if (!layer)
- continue;
- if (g::pLocalEntity->get_sequence_act(layer->m_nSequence) == 979 && (layer->m_flPrevCycle) != (layer->m_flCycle))
- v6 = g::pLocalEntity->GetLowerBodyYaw();
- }
- float v20 = (AnimState->m_vVelocityX) * v23;
- float a1 = (AnimState->m_vVelocityY) * v23;
- float v30 = 0.0;
- float eye_angles_y = AnimState->m_flEyeYaw;
- float goal_feet_yaw = AnimState->m_flGoalFeetYaw;
- float v22 = fabs(eye_angles_y - goal_feet_yaw);
- if (v20 < v22)
- {
- float v11 = fabs(v20);
- v30 = eye_angles_y - v11;
- }
- else if (a1 > v22)
- {
- float v12 = fabs(a1);
- v30 = v12 + eye_angles_y;
- }
- float v36 = std::fmodf((v30), 360.0);
- if (v36 > 180.0)
- v36 = v36 - 360.0;
- if (v36 < 180.0)
- v36 = v36 + 360.0;
- AnimState->m_flGoalFeetYaw = v36;
- if (g::missedshoted > 2)
- {
- int v19 = g::MissedShots[pEnt->EntIndex()] % 4;
- switch (v19)
- {
- case 0:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw + 45.0;
- break;
- case 1:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw - 45.0;
- break;
- case 2:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw - 30.0;
- break;
- case 3:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw + 30.0;
- break;
- default:
- return;
- }
- fix_goal_feet_yaw(max, inverted, yawfeetdelta, yaw, AnimState);
- pEnt->AnimState()->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw;
- }
- // xy0's ""reversed"" resolver which is pretty much our static desync but ok
- // else if (g::MissedShots[pEnt->EntIndex()] < 2) {
- float m_flLastClientSideAnimationUpdateTimeDelta = fabs(AnimState->m_iLastClientSideAnimationUpdateFramecount - AnimState->m_flLastClientSideAnimationUpdateTime);
- auto v48 = 0.f;
- if (AnimState->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
- {
- v48 = fminf(AnimState->m_flFeetSpeedForwardsOrSideWays, 1.0f);
- }
- else
- {
- v48 = 0.0f;
- brutev2(0, player, feet_eye, pEnt);
- }
- if (AnimState->m_fDuckAmount > 0.0)
- {
- float v53 = 0.0f;
- if (AnimState->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
- {
- v53 = fminf(AnimState->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
- }
- else
- {
- v53 = 0.0f;
- // brutev2(1, player, pEnt->GetLowerBodyYaw(), pEnt);
- }
- if (g::missedshoted > 7)
- brutev2(1, player, pEnt->GetLowerBodyYaw(), pEnt);
- else if (g::missedshoted > 8)
- brutev2(2, player, original_lby[pEnt->EntIndex()], pEnt);
- }
- /*if (local_player)
- {
- for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
- {
- //player = GetClientEntity(g_EntityList, i);
- if (local_player->IsAlive() && local_player->IsDormant())// dormant
- {
- // auto v29 = AnimState->m_flEyeYaw == 0.0 ? -60 : 58;
- // if (v29)
- // return;
- auto v28 = AnimState->m_flEyeYaw == 0.0 ? -58 : 580; // 58
- if (v28)
- return;
- auto v27 = AnimState->m_flEyeYaw == 0.0 ? -90 : 90; // 89
- if (v27)
- return;
- auto v26 = AnimState->m_flEyeYaw == 0.0 ? -80 : 80; // 79
- if (v26)
- return;
- auto v25 = AnimState->m_flEyeYaw == 0.0 ? -60 : 60; // 125
- if (v25)
- return;
- auto v24 = AnimState->m_flEyeYaw == 0.0 ? -118 : 118; // 78
- if (v24)
- return;
- }
- float v8 = 0;
- float v7 = 0;
- float v6 = 0;
- for (size_t i = 0; i < g::pLocalEntity->GetNumAnimOverlays(); i++)
- {
- auto layer = g::pLocalEntity->get_anim_overlay_index(i);
- if (!layer)
- continue;
- if (g::pLocalEntity->get_sequence_act(layer->m_nSequence) == 979 && (layer->m_flPrevCycle) != (layer->m_flCycle))
- v6 = g::pLocalEntity->GetLowerBodyYaw();
- }
- float v20 = (AnimState->m_vVelocityX) * v23;
- float a1 = (AnimState->m_vVelocityY) * v23;
- float v30 = 0.0;
- float eye_angles_y = AnimState->m_flEyeYaw;
- float goal_feet_yaw = AnimState->m_flGoalFeetYaw;
- float v22 = fabs(eye_angles_y - goal_feet_yaw);
- if (v20 < v22)
- {
- float v11 = fabs(v20);
- v30 = eye_angles_y - v11;
- }
- else if (a1 > v22)
- {
- float v12 = fabs(a1);
- v30 = v12 + eye_angles_y;
- }
- float v36 = std::fmodf((v30), 360.0);
- if (v36 > 180.0)
- v36 = v36 - 360.0;
- if (v36 < 180.0)
- v36 = v36 + 360.0;
- AnimState->m_flGoalFeetYaw = v36;
- if (g::missedshoted > 2)
- {
- int v19 = g::MissedShots[pEnt->EntIndex()] % 3;
- switch (v19)
- {
- case 0:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw + 45.0;
- break;
- case 1:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw - 45.0;
- break;
- case 2:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw - 30.0;
- break;
- case 3:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw + 30.0;
- break;
- default:
- return;
- } */
- float v49 = ((AnimState->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;
- float flYawModifier = v49 + 1.0;
- /* if (AnimState->m_fDuckAmount > 0.0)
- {
- float v53 = 0.0f;
- if (AnimState->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
- {
- v53 = fminf(AnimState->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
- }
- else
- {
- v53 = 0.0f;
- // brutev2(1, player, pEnt->GetLowerBodyYaw(), pEnt);
- }
- if (g::missedshoted > 5)
- brutev2(1, player, pEnt->GetLowerBodyYaw(), pEnt);
- else if (g::missedshoted > 6)
- brutev2(2, player, original_lby[pEnt->EntIndex()], pEnt);
- } */
- float flMaxYawModifier = AnimState->pad10[516] * flYawModifier;
- float flMinYawModifier = AnimState->pad10[512] * flYawModifier;
- float newFeetYaw = 0.f;
- auto eyeYaw = AnimState->m_flEyeYaw;
- auto lbyYaw = AnimState->m_flGoalFeetYaw;
- float eye_feet_delta = fabs(eyeYaw - lbyYaw);
- float flEyeDiff = std::remainderf(eyeYaw - lbyYaw, 360.f);
- if (eye_feet_delta <= flMaxYawModifier)
- {
- if (flMinYawModifier > eye_feet_delta)
- {
- newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
- }
- }
- else
- {
- newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
- }
- float v136 = fmod(newFeetYaw, 360.0);
- if (v136 > 180.0)
- {
- v136 = v136 - 360.0;
- }
- if (v136 < 180.0)
- {
- v136 = v136 + 360.0;
- }
- AnimState->m_flGoalFeetYaw = v136;
- }
- // else {
- // brutev2(2, player, original_lby[pEnt->EntIndex()], pEnt);
- }
- // g::MissedShots[pEnt->EntIndex()] = g::MissedShots[pEnt->EntIndex()] % 6; // so it just doesn't brute all the fucking time, that's dumb.
- }
- }
- void Resolver::Resolve1(C_BaseEntity* pEnt, C_BaseEntity* pLocalEnt)
- {
- static float ShotTime[65];
- static float oldSimtime[65];
- static float storedSimtime[65];
- static Vector oldEyeAngles[65];
- static float oldGoalfeetYaw[65];
- static Vector oldOrigin[65];
- auto AnimState = pEnt->AnimState();
- float speedfraction = 0.0;
- if (AnimState->m_flFeetSpeedForwardsOrSideWays < 0.0)
- speedfraction = 0.0;
- else
- speedfraction = AnimState->m_flFeetSpeedForwardsOrSideWays;
- float v2 = (AnimState->m_flStopToFullRunningFraction * -0.30000001 - 0.19999999) * speedfraction;
- float v18 = v2;
- float v3 = v2 + 1.0;
- float v23 = v3;
- float original_lby[65] = { FLT_MAX };
- auto fix_goal_feet_yaw = [](float rotation, float invertedrotation, float yawfeetdelta, float yaw, C_AnimState* state) {
- if (yawfeetdelta < rotation) {
- if (invertedrotation > yawfeetdelta)
- * (float*)(uintptr_t(state) + 0x80) = invertedrotation + yaw;
- }
- else
- *(float*)(uintptr_t(state) + 0x80) = yaw - rotation;
- };
- auto get_rotation = [&](int rotation_type, C_AnimState* state) {
- float v43 = *(float*)((uintptr_t)state + 0xA4);
- float v54 = max(0, min(*reinterpret_cast<float*>((uintptr_t)state + 0xF8), 1));
- float v55 = max(0, min(1, *reinterpret_cast<float*>((uintptr_t)state + 0xFC)));
- float v56;
- v56 = ((*reinterpret_cast<float*>((uintptr_t)state + 0x11C) * -0.30000001) - 0.19999999) * v54;
- if (v43 > 0)
- v56 += ((v43 * v55) * (0.5 - v56));
- v56 = *(float*)((uintptr_t)state + rotation_type) * v56;
- return v56;
- };
- float feet_eye = NormalizeYaw180(AnimState->m_flGoalFeetYaw - pEnt->GetEyeAngles().y);
- float inverted = get_rotation(0x2B4, AnimState);
- float max = get_rotation(0x2B0, AnimState);
- float yawfeetdelta = AnimState->m_flEyeYaw - AnimState->m_flGoalFeetYaw;
- float yaw = pEnt->GetEyeAngles().y;
- float* PosParams = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(pEnt) + 0x2774);
- bool shot = false;
- //auto AnimState = pEnt->AnimState();
- //auto* AnimState = pEnt->AnimState();
- if (!AnimState || !pEnt->AnimOverlays() || !PosParams)
- return;
- if (*reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(AnimState) + 0x164) < 0) // sorry had to anti pasta this basically the key to nospread
- * reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(AnimState) + 0x110) = 0.f;
- bool update = false;
- auto v48 = 0.f;
- if (AnimState->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
- {
- v48 = fminf(AnimState->m_flFeetSpeedForwardsOrSideWays, 1.0f);
- }
- else
- {
- v48 = 0.0f;
- //brutev2(0, player, feet_eye, pEnt);
- }
- float v49 = ((AnimState->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;
- float flYawModifier = v49 + 1.0;
- float flMaxYawModifier = AnimState->pad10[516] * flYawModifier;
- float flMinYawModifier = AnimState->pad10[512] * flYawModifier;
- float newFeetYaw = 0.f;
- auto eyeYaw = AnimState->m_flEyeYaw;
- auto lbyYaw = AnimState->m_flGoalFeetYaw;
- float eye_feet_delta = fabs(eyeYaw - lbyYaw);
- float flEyeDiff = std::remainderf(eyeYaw - lbyYaw, 360.f);
- if (eye_feet_delta <= flMaxYawModifier)
- {
- if (flMinYawModifier > eye_feet_delta)
- {
- newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
- }
- }
- else
- {
- newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
- }
- float v136 = fmod(newFeetYaw, 360.0);
- if (v136 > 180.0)
- {
- v136 = v136 - 360.0;
- }
- if (v136 < 180.0)
- {
- v136 = v136 + 360.0;
- }
- AnimState->m_flGoalFeetYaw = v136;
- oldGoalfeetYaw[pEnt->EntIndex()] = AnimState->m_flGoalFeetYaw;
- if (pLocalEnt && pLocalEnt->IsAlive())
- {
- fix_goal_feet_yaw(max, inverted, yawfeetdelta, yaw, AnimState);
- float angToLocal = g_Math.NormalizeYaw(g_Math.CalcAngle(pLocalEnt->GetOrigin(), pEnt->GetOrigin()).y);
- float Back = g_Math.NormalizeYaw(angToLocal);
- float DesyncFix = 0;
- float Resim = g_Math.NormalizeYaw((TICKS_TO_TIME(16) / (pEnt->GetSimulationTime() - oldSimtime[pEnt->EntIndex()])) * g_Math.NormalizeYaw(oldEyeAngles[pEnt->EntIndex()].y - pEnt->GetEyeAngles().y));
- if (Resim > 60.f)
- Resim = 60.f;
- if (Resim < -60.f)
- Resim = -60.f;
- if (g_Menu.Config.Resolve1 && !shot && !isnan(angToLocal) && !isinf(angToLocal) && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam())
- {
- float AntiSide = 0.f;
- if (g::MissedShots[pEnt->EntIndex()] % 2)
- {
- if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Back) > 0.f)
- AntiSide = -90.f;
- else if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Back) < 0.f)
- AntiSide = 90.f;
- }
- else
- {
- if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - g_Math.NormalizeYaw(Back + 90)) > 0.f)
- AntiSide = 180.f;
- else if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - g_Math.NormalizeYaw(Back + 90)) < 0.f)
- AntiSide = 0.f;
- }
- float Brute = g_Math.NormalizeYaw(Back + AntiSide);
- float Delta = g_Math.NormalizeYaw(g_Math.NormalizeYaw(Brute - pEnt->GetEyeAngles().y) + Resim);
- if (Delta > 58.f) // who needs clamps
- Delta = 58.f;
- if (Delta < -58.f)
- Delta = -58.f;
- Resim += Delta;
- DesyncFix += Delta;
- if (Resim > 60.f)
- Resim = 60.f;
- if (Resim < -60.f)
- Resim = -60.f;
- }
- if (g::missedshoted > 4)
- {
- int v19 = g::MissedShots[pEnt->EntIndex()] % 4;
- switch (v19)
- {
- case 0:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw + 45.0;
- break;
- case 1:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw - 45.0;
- break;
- case 2:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw - 30.0;
- break;
- case 3:
- AnimState->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw + 30.0;
- break;
- default:
- return;
- }
- float Equalized;
- // if (fabs(g_Math.NormalizeYaw(oldEyeAngles[pEnt->EntIndex()].y - pEnt->GetEyeAngles().y)) < 60.f) // yea basically im retarded
- Equalized = g_Math.NormalizeYaw(pEnt->GetEyeAngles().y + Resim);
- // else
- // Equalized = g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Resim);
- if (g_Menu.Config.Resolve1 && !shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && (pEnt->GetFlags() & FL_ONGROUND))
- AnimState->m_flGoalFeetYaw = Equalized;
- } //b resolver?
- if (shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && PosParams[12] <= -80) // ez shot pitch fix LMAO
- PosParams[12] = 89.f;
- pEnt->SetAbsAngles(Vector(0, oldGoalfeetYaw[pEnt->EntIndex()], 0));
- }
- }
- void Resolver::OnCreateMove() // cancer v2
- {
- //if (!g_Menu.Config.Resolver)
- // return;
- //if (!g_Menu.Config.Resolve1)
- // return;
- //if (!g_Menu.Config.Resolver2)
- // return;
- if (!g_pEngine->IsInGame() && !g_pEngine->IsConnected())
- return;
- if (!g::pLocalEntity->IsAlive())
- return;
- if (!g::pLocalEntity->GetActiveWeapon())
- return; // why wouldnt u resolve people when u have a knife out retard
- for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
- {
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
- if (!pPlayerEntity
- || !pPlayerEntity->IsAlive()
- || pPlayerEntity->IsDormant()
- || pPlayerEntity == g::pLocalEntity
- || pPlayerEntity->GetTeam() == g::pLocalEntity->GetTeam())
- {
- UseFreestandAngle[i] = false;
- continue;
- }
- if (abs(pPlayerEntity->GetVelocity().Length2D()) > 29.f)
- UseFreestandAngle[pPlayerEntity->EntIndex()] = false;
- if (abs(pPlayerEntity->GetVelocity().Length2D()) <= 29.f && !UseFreestandAngle[pPlayerEntity->EntIndex()])
- {
- bool Autowalled = false, HitSide1 = false, HitSide2 = false;
- float angToLocal = g_Math.CalcAngle(g::pLocalEntity->GetOrigin(), pPlayerEntity->GetOrigin()).y;
- Vector ViewPoint = g::pLocalEntity->GetOrigin() + Vector(0, 0, 90);
- Vector2D Side1 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal))),(45 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
- Vector2D Side2 = { (45 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(45 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };
- Vector2D Side3 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal))),(50 * cos(g_Math.GRD_TO_BOG(angToLocal))) };
- Vector2D Side4 = { (50 * sin(g_Math.GRD_TO_BOG(angToLocal + 180))) ,(50 * cos(g_Math.GRD_TO_BOG(angToLocal + 180))) };
- Vector Origin = pPlayerEntity->GetOrigin();
- Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };
- Vector2D OriginLeftRightLocal[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };
- for (int side = 0; side < 2; side++)
- {
- Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x, Origin.y - OriginLeftRight[side].y , Origin.z + 90 };
- Vector OriginAutowall2 = { ViewPoint.x + OriginLeftRightLocal[side].x, ViewPoint.y - OriginLeftRightLocal[side].y , ViewPoint.z };
- if (g_Autowall.CanHitFloatingPoint(OriginAutowall, ViewPoint))
- {
- if (side == 0)
- {
- HitSide1 = true;
- FreestandAngle[pPlayerEntity->EntIndex()] = 90;
- }
- else if (side == 1)
- {
- HitSide2 = true;
- FreestandAngle[pPlayerEntity->EntIndex()] = -90;
- }
- Autowalled = true;
- }
- else
- {
- for (int side222 = 0; side222 < 2; side222++)
- {
- Vector OriginAutowall222 = { Origin.x + OriginLeftRight[side222].x, Origin.y - OriginLeftRight[side222].y , Origin.z + 90 };
- if (g_Autowall.CanHitFloatingPoint(OriginAutowall222, OriginAutowall2))
- {
- if (side222 == 0)
- {
- HitSide1 = true;
- FreestandAngle[pPlayerEntity->EntIndex()] = 90;
- }
- else if (side222 == 1)
- {
- HitSide2 = true;
- FreestandAngle[pPlayerEntity->EntIndex()] = -90;
- }
- Autowalled = true;
- }
- }
- }
- }
- if (Autowalled)
- {
- if (HitSide1 && HitSide2)
- UseFreestandAngle[pPlayerEntity->EntIndex()] = false;
- else
- UseFreestandAngle[pPlayerEntity->EntIndex()] = true;
- }
- }
- // bad idea but ill try this why not
- if (UseFreestandAngle[pPlayerEntity->EntIndex()] && g::MissedShots[pPlayerEntity->EntIndex()] < 4) {
- pPlayerEntity->SetEyeAngles(Vector(pPlayerEntity->GetEyeAngles().x, pPlayerEntity->GetEyeAngles().y + FreestandAngle[pPlayerEntity->EntIndex()], pPlayerEntity->GetEyeAngles().z));
- }
- }
- }
- float approach(float cur, float target, float inc) {
- inc = abs(inc);
- if (cur < target)
- return min(cur + inc, target);
- if (cur > target)
- return max(cur - inc, target);
- return target;
- }
- /*float NormalizeYaw180(float yaw)
- {
- if (yaw > 180)
- yaw -= (round(yaw / 360) * 360.f);
- else if (yaw < -180)
- yaw += (round(yaw / 360) * -360.f);
- return yaw;
- } */
- float angle_difference(float a, float b) {
- auto diff = NormalizeYaw180(a - b);
- if (diff < 180)
- return diff;
- return diff - 360;
- }
- float approach_angle(float cur, float target, float inc) {
- auto diff = angle_difference(target, cur);
- return approach(cur, cur + diff, inc);
- }
- bool solve_desync_simple(IClientEntity* e)
- {
- if (!e || e->IsDormant() || !g::pLocalEntity->IsAlive())
- return false;
- for (size_t i = 0; i < g::pLocalEntity->GetNumAnimOverlays(); i++)
- {
- auto layer = g::pLocalEntity->get_anim_overlay_index(i);
- if (!layer)
- continue;
- /*if (e->get_sequence_act(layer->m_nSequence) == 979) */
- {
- if (layer->m_flWeight == 0.0f && (layer->m_flCycle == 0.0f || layer->m_flCycle != layer->m_flPrevCycle))
- return true;
- }
- }
- return false;
- }
- bool breaking_lby_animations(IClientEntity* e)
- {
- if (!e || e->IsDormant() || !g::pLocalEntity->IsAlive())
- return false;
- for (size_t i = 0; i < g::pLocalEntity->GetNumAnimOverlays(); i++)
- {
- auto layer = g::pLocalEntity->get_anim_overlay_index(i);
- // if (g::pLocalEntity->GetSequence(g::pLocalEntity->m_nSequence) == 979)
- {
- if (layer->m_flCycle != layer->m_flCycle || layer->m_flWeight == 1.f)
- return true;
- // }
- }
- return false;
- }
- }
- Vector CalcAngleToEnt(const Vector& vecSource, const Vector& vecDestination)
- {
- Vector qAngles;
- Vector delta = Vector((vecSource[0] - vecDestination[0]), (vecSource[1] - vecDestination[1]), (vecSource[2] - vecDestination[2]));
- float hyp = sqrtf(delta[0] * delta[0] + delta[1] * delta[1]);
- qAngles[0] = (float)(atan(delta[2] / hyp) * (180.0f / M_PI));
- qAngles[1] = (float)(atan(delta[1] / delta[0]) * (180.0f / M_PI));
- qAngles[2] = 0.f;
- if (delta[0] >= 0.f)
- qAngles[1] += 180.f;
- return qAngles;
- }
- float feet_yaw_delta(float first, float second)
- {
- return first - second;
- }
- bool delta_35(float first, float second)
- {
- if (first - second <= 35.f && first - second >= -35.f)
- {
- return true;
- }
- return false;
- }
- bool delta_20(float first, float second)
- {
- if (first - second <= 20.f && first - second >= -20.f)
- {
- return true;
- }
- return false;
- }
- void brute(int stage, IClientEntity* player, float yaw_value, C_BaseEntity* pEnt)
- {
- switch (stage)
- {
- case 0: // no delta check / low jitter
- {
- switch (g::MissedShots[pEnt->EntIndex()] % 3)
- {
- case 0: pEnt->GetEyeAnglesXY()->y -= -yaw_value;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y += -yaw_value;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y -= 45.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y += 45.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value - 90.f;
- break;
- }
- }
- break;
- case 1: // low delta break / limited jitter
- {
- switch (g::MissedShots[pEnt->EntIndex()] % 3)
- {
- case 0: pEnt->GetEyeAnglesXY()->y += 20.f;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y += 45.f;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y -= 20.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y -= 45.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value;
- break;
- default: pEnt->GetEyeAnglesXY()->y -= pEnt->GetLowerBodyYaw() - pEnt->GetEyeAnglesXY()->y;
- }
- }
- break;
- case 2: // high delta break / high jitter
- {
- switch (g::MissedShots[pEnt->EntIndex()] % 4)
- {
- case 0: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - 40.f;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() + 40.f;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - 90.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y = yaw_value - 29.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value + 29.f;
- break;
- }
- }
- }
- }
- void Resolver::resolve_mirror_primary(IClientEntity * player, float yaw_value, C_BaseEntity* pEnt)
- {
- // bool enemy_fake[65] = { false };
- C_BaseCombatWeapon* weapon = (C_BaseCombatWeapon*)g::pLocalEntity->GetActiveWeapon();
- float moving_lby[65] = { FLT_MAX };
- float old_eyes[65] = { FLT_MAX };
- float delta[65] = { FLT_MAX };
- float old_lby[65] = { FLT_MAX };
- float update_time[65] = { FLT_MAX };
- float original_lby[65] = { FLT_MAX };
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(0);
- bool fake = false;
- bool did_move[65] = { false };
- auto lby_update = pEnt->GetAnimationTime();
- bool is_moving = pPlayerEntity->GetVelocity().Length2D() > 0.1f && (pPlayerEntity->GetFlags() & FL_ONGROUND);
- if (!player || !(pPlayerEntity->GetFlags() & FL_ONGROUND))
- return;
- if (player->IsDormant())
- {
- moving_lby[pEnt->EntIndex()] = { FLT_MAX };
- }
- if (!delta_35(pEnt->GetEyeAngles().y, pEnt->GetLowerBodyYaw()) && g::MissedShots[pEnt->EntIndex()] > 3)
- {
- resolver->enemy_fake[pEnt->EntIndex()] = true;
- fake = true;
- }
- else
- {
- resolver->enemy_fake[pEnt->EntIndex()] = false;
- fake = false;
- }
- auto state = pEnt->GetPlayerAnimationState();
- if (state)
- {
- state->m_flEyeYaw = pEnt->GetEyeAngles().y;
- state->m_flEyePitch = pEnt->GetEyeAngles().x;
- pEnt->setAnimationState(state);
- }
- if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
- {
- state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
- ((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);
- update_time[pEnt->EntIndex()] = pEnt->GetAnimationTime() + 0.22f;
- pEnt->setAnimationState(state);
- }
- else
- {
- if (state)
- {
- state->m_flGoalFeetYaw = approach_angle(pEnt->GetLowerBodyYaw(), state->m_flGoalFeetYaw,
- state->m_flLastClientSideAnimationUpdateTime * 100.0f);
- update_time[pEnt->EntIndex()] = pEnt->GetAnimationTime() + 1.1f;
- pEnt->setAnimationState(state);
- }
- }
- if (is_moving)
- {
- if (moving_lby[pEnt->EntIndex()] != pEnt->GetLowerBodyYaw())
- moving_lby[pEnt->EntIndex()] = pEnt->GetLowerBodyYaw();
- old_lby[pEnt->EntIndex()] = pEnt->GetLowerBodyYaw();
- did_move[pEnt->EntIndex()] = true;
- }
- float delta_eye_lby = pEnt->GetEyeAngles().y - pEnt->GetLowerBodyYaw();
- float delta_lby;
- if (pPlayerEntity->GetVelocity().Length2D() > 0.1f && (pPlayerEntity->GetFlags() & FL_ONGROUND))
- {
- if (state)
- {
- if (original_lby[pEnt->EntIndex()] == FLT_MAX)
- {
- original_lby[pEnt->EntIndex()] = pEnt->GetLowerBodyYaw();
- }
- if (old_lby[pEnt->EntIndex()] == FLT_MAX)
- {
- old_lby[pEnt->EntIndex()] = pEnt->GetLowerBodyYaw();
- }
- else
- {
- delta_lby = old_lby[pEnt->EntIndex()] - pEnt->GetLowerBodyYaw();
- }
- }
- }
- else
- {
- if (original_lby[pEnt->EntIndex()] != pEnt->GetLowerBodyYaw())
- original_lby[pEnt->EntIndex()] = pEnt->GetLowerBodyYaw();
- }
- #pragma region Alright now we will do the b1g resolve
- float feet_eye = NormalizeYaw180(state->m_flGoalFeetYaw - pEnt->GetEyeAngles().y);
- if (breaking_lby_animations(player))
- {
- if (g::MissedShots[pEnt->EntIndex()] < 2)
- {
- if (delta_35(original_lby[pEnt->EntIndex()], pEnt->GetLowerBodyYaw())) // since 180 jitter with max delta will make the difference between 90º lby and eyes 38
- {
- pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - delta_eye_lby;
- }
- else
- {
- pEnt->GetEyeAnglesXY()->y = original_lby[pEnt->EntIndex()];
- }
- }
- else
- brute(2, player, original_lby[pEnt->EntIndex()], pEnt);
- /* switch (g::MissedShots[pEnt->EntIndex()] % 4)
- {
- case 0: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - 40.f;
- break;
- case 1: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() + 40.f;
- break;
- case 2: pEnt->GetEyeAnglesXY()->y = pEnt->GetLowerBodyYaw() - 90.f;
- break;
- case 3: pEnt->GetEyeAnglesXY()->y = yaw_value - 29.f;
- break;
- case 4: pEnt->GetEyeAnglesXY()->y = yaw_value + 29.f;
- break;
- } */
- }
- else
- {
- if (solve_desync_simple(player))
- {
- if (delta_eye_lby > 58.f)
- delta_eye_lby = 58.f;
- if (delta_eye_lby < -58.f)
- delta_eye_lby = -58.f;
- if (g::MissedShots[pEnt->EntIndex()] < 2)
- {
- pEnt->GetEyeAngles() -= delta_eye_lby;
- }
- else
- brute(1, player, pEnt->GetLowerBodyYaw(), pEnt);
- }
- else
- {
- if (g::MissedShots[pEnt->EntIndex()] < 2)
- {
- pEnt->GetEyeAnglesXY()->y -= g::MissedShots[pEnt->EntIndex()] < 1 ? feet_eye : -feet_eye;
- }
- else
- brute(0, player, feet_eye, pEnt);
- }
- g::MissedShots[pEnt->EntIndex()] = g::MissedShots[pEnt->EntIndex()] % 6;
- }
- }
- int C_BaseEntity::get_sequence_act(int sequence)
- {
- auto hdr = g_pModelInfo->GetStudiomodel(this->GetModel());
- if (!hdr)
- return -1;
- static auto get_sequence_activity = reinterpret_cast< int(__fastcall*)(void*, studiohdr_t*, int) >((DWORD)
- Utils::FindSignature("client_panorama.dll", "55 8B EC 53 8B 5D 08 56 8B F1 83"/*"55 8B EC 83 7D 08 FF 56 8B F1 74"*/));
- return get_sequence_activity(this, hdr, sequence);
- }
- /*void Resolver::fatality(IClientEntity * localplayer, IClientEntity * enemy, C_BaseEntity* pEnt )
- {
- auto animstate = pEnt->GetPlayerAnimationState();
- auto animstate = pEnt->AnimState();
- auto local_player = g::pLocalEntity;
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(0);
- // auto animstate = localplayer->GetBasePlayerAnimState();
- if (animstate)
- { // inlined max_desync_delta
- float v9 = fabs(animstate->m_iLastClientSideAnimationUpdateFramecount - animstate->m_flLastClientSideAnimationUpdateTime);
- float speedfraction = 0.0;
- if (animstate->m_flFeetSpeedForwardsOrSideWays < 0.0)
- speedfraction = 0.0;
- else
- speedfraction = animstate->m_flFeetSpeedForwardsOrSideWays;
- float v2 = (animstate->m_flStopToFullRunningFraction * -0.30000001 - 0.19999999) * speedfraction;
- float v18 = v2;
- float v3 = v2 + 1.0;
- float v23 = v3;
- if (animstate->m_fDuckAmount > 0.0)
- {
- float v29 = 0.0;
- if (animstate->m_flFeetSpeedUnknownForwardOrSideways < 0.0)
- v29 = 0.0;
- else
- v29 = fminf((animstate->m_flFeetSpeedUnknownForwardOrSideways), 0x3F800000);
- }
- if (localplayer)
- {
- for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
- {
- if (enemy)// dormant
- {
- float v28 = pPlayerEntity->GetEyeAngles().y == 0.0 ? -58 : 58;
- if (v28)
- return;
- float v27 = pPlayerEntity->GetEyeAngles().y == 0.0 ? -89 : 89;
- if (v27)
- return;
- float v26 =pPlayerEntity->GetEyeAngles().y == 0.0 ? -79 : 79;
- if (v26)
- return;
- float v25 = pPlayerEntity->GetEyeAngles().y == 0.0 ? -125 : 125;
- if (v25)
- return;
- float v24 = pPlayerEntity->GetEyeAngles().y == 0.0 ? -78 : 78;
- if (v24)
- return;
- }
- }
- float v8 = 0;
- float v7 = 0;
- float v6 = 0;
- for (size_t i = 0; i < g::pLocalEntity->GetNumAnimOverlays(); i++)
- {
- auto layer = g::pLocalEntity->get_anim_overlay_index(i);
- if (!layer)
- continue;
- if (g::pLocalEntity->get_sequence_act(layer->m_nSequence) == 979 && (layer->m_flPrevCycle) != (layer->m_flCycle))
- v6 = g::pLocalEntity->GetLowerBodyYaw();
- }
- float v20 = (animstate->m_vVelocityX) * v23;
- float a1 = (animstate->m_vVelocityY ) * v23;
- float v30 = 0.0;
- float eye_angles_y = animstate->m_flEyeYaw;
- float goal_feet_yaw = animstate->m_flGoalFeetYaw;
- float v22 = fabs(eye_angles_y - goal_feet_yaw);
- if (v20 < v22)
- {
- float v11 = fabs(v20);
- v30 = eye_angles_y - v11;
- }
- else if (a1 > v22)
- {
- float v12 = fabs(a1);
- v30 = v12 + eye_angles_y;
- }
- float v36 = std::fmodf((v30), 360.0);
- if (v36 > 180.0)
- v36 = v36 - 360.0;
- if (v36 < 180.0)
- v36 = v36 + 360.0;
- animstate->m_flGoalFeetYaw = v36;
- if (g::missedshoted > 2)
- {
- int v19 = g::MissedShots[pEnt->EntIndex()] % 4;
- switch (v19)
- {
- case 0:
- animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 45.0;
- break;
- case 1:
- animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 45.0;
- break;
- case 2:
- animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 30.0;
- break;
- case 3:
- animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 30.0;
- break;
- default:
- return;
- }
- }
- }
- }
- } */
- void Resolver::Resolve(C_BaseEntity* pEnt, C_BaseEntity* pLocalEnt) {
- if (g_Menu.Config.Resolver)
- return;
- if (pEnt->GetTeam() == g::pLocalEntity->GetTeam())
- return;
- const auto player_animation_state = pEnt->AnimState();
- static float ShotTime[65];
- static float oldSimtime[65];
- static float storedSimtime[65];
- static Vector oldEyeAngles[65];
- static float oldGoalfeetYaw[65];
- static Vector oldOrigin[65];
- auto AnimState = pEnt->AnimState();
- float speedfraction = 0.0;
- if (AnimState->m_flFeetSpeedForwardsOrSideWays < 0.0)
- speedfraction = 0.0;
- else
- speedfraction = AnimState->m_flFeetSpeedForwardsOrSideWays;
- float v2 = (AnimState->m_flStopToFullRunningFraction * -0.30000001 - 0.19999999) * speedfraction;
- float v18 = v2;
- float v3 = v2 + 1.0;
- float v23 = v3;
- float original_lby[65] = { FLT_MAX };
- auto fix_goal_feet_yaw = [](float rotation, float invertedrotation, float yawfeetdelta, float yaw, C_AnimState* state) {
- if (yawfeetdelta < rotation) {
- if (invertedrotation > yawfeetdelta)
- * (float*)(uintptr_t(state) + 0x80) = invertedrotation + yaw;
- }
- else
- *(float*)(uintptr_t(state) + 0x80) = yaw - rotation;
- };
- auto get_rotation = [&](int rotation_type, C_AnimState* state) {
- float v43 = *(float*)((uintptr_t)state + 0xA4);
- float v54 = max(0, min(*reinterpret_cast<float*>((uintptr_t)state + 0xF8), 1));
- float v55 = max(0, min(1, *reinterpret_cast<float*>((uintptr_t)state + 0xFC)));
- float v56;
- v56 = ((*reinterpret_cast<float*>((uintptr_t)state + 0x11C) * -0.30000001) - 0.19999999) * v54;
- if (v43 > 0)
- v56 += ((v43 * v55) * (0.5 - v56));
- v56 = *(float*)((uintptr_t)state + rotation_type) * v56;
- return v56;
- };
- float feet_eye = NormalizeYaw180(AnimState->m_flGoalFeetYaw - pEnt->GetEyeAngles().y);
- float inverted = get_rotation(0x2B4, AnimState);
- float max = get_rotation(0x2B0, AnimState);
- float yawfeetdelta = AnimState->m_flEyeYaw - AnimState->m_flGoalFeetYaw;
- float yaw = pEnt->GetEyeAngles().y;
- float* PosParams = reinterpret_cast<float*>(reinterpret_cast<uintptr_t>(pEnt) + 0x2774);
- bool shot = false;
- if (!player_animation_state)
- return;
- if (pLocalEnt && pLocalEnt->IsAlive())
- {
- float angToLocal = g_Math.NormalizeYaw(g_Math.CalcAngle(pLocalEnt->GetOrigin(), pEnt->GetOrigin()).y);
- float Back = g_Math.NormalizeYaw(angToLocal);
- float DesyncFix = 0;
- float Resim = g_Math.NormalizeYaw((TICKS_TO_TIME(16) / (pEnt->GetSimulationTime() - oldSimtime[pEnt->EntIndex()])) * g_Math.NormalizeYaw(oldEyeAngles[pEnt->EntIndex()].y - pEnt->GetEyeAngles().y));
- if (Resim > 60.f)
- Resim = 60.f;
- if (Resim < -60.f)
- Resim = -60.f;
- if (g_Menu.Config.Resolver && !shot && !isnan(angToLocal) && !isinf(angToLocal) && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam())
- {
- fix_goal_feet_yaw(max, inverted, yawfeetdelta, yaw, AnimState);
- pEnt->AnimState()->m_flGoalFeetYaw = AnimState->m_flGoalFeetYaw;
- float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);
- auto v48 = 0.f;
- if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
- {
- v48 = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
- }
- else
- {
- v48 = 0.0f;
- }
- float v49 = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;
- float flYawModifier = v49 + 1.0;
- if (player_animation_state->m_fDuckAmount > 0.0)
- {
- float v53 = 0.0f;
- if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
- {
- v53 = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
- }
- else
- {
- v53 = 0.0f;
- }
- }
- float flMaxYawModifier = player_animation_state->pad10[516] * flYawModifier;
- float flMinYawModifier = player_animation_state->pad10[512] * flYawModifier;
- float newFeetYaw = 0.f;
- auto eyeYaw = player_animation_state->m_flEyeYaw;
- auto lbyYaw = player_animation_state->m_flGoalFeetYaw;
- float eye_feet_delta = fabs(eyeYaw - lbyYaw);
- if (eye_feet_delta <= flMaxYawModifier)
- {
- if (flMinYawModifier > eye_feet_delta)
- {
- eyeYaw -= fabs(flMinYawModifier) + eye_feet_delta;
- }
- }
- if (lbyYaw > newFeetYaw) // if lby is greater than his feet
- {
- if (eyeYaw < lbyYaw)
- {
- if (newFeetYaw >= flMaxYawModifier)
- {
- lbyYaw -= eye_feet_delta + fabs(flMinYawModifier);
- }
- }
- }
- if (flMaxYawModifier > newFeetYaw)
- {
- if (eye_feet_delta < flMinYawModifier)
- {
- newFeetYaw += fabs(flMaxYawModifier) - eyeYaw;
- }
- }
- else {
- eyeYaw -= eye_feet_delta + lbyYaw;
- }
- float v136 = fmod(newFeetYaw, 360.0);
- if (v136 > 90.0)
- {
- v136 = v136 - 180.0;
- }
- if (v136 < 90.0)
- {
- v136 = v136 + 180.0;
- }
- player_animation_state->m_flGoalFeetYaw = v136;
- float AntiSide = 0.f;
- if (g::MissedShots[pEnt->EntIndex()] % 2)
- {
- if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Back) > 0.f)
- AntiSide = -90.f;
- else if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Back) < 0.f)
- AntiSide = 90.f;
- }
- else
- {
- if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - g_Math.NormalizeYaw(Back + 90)) > 0.f)
- AntiSide = 180.f;
- else if (g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - g_Math.NormalizeYaw(Back + 90)) < 0.f)
- AntiSide = 0.f;
- }
- float Brute = g_Math.NormalizeYaw(Back + AntiSide);
- float Delta = g_Math.NormalizeYaw(g_Math.NormalizeYaw(Brute - pEnt->GetEyeAngles().y) + Resim);
- if (Delta > 60.f) // who needs clamps
- Delta = 60.f;
- if (Delta < -60.f)
- Delta = -60.f;
- Resim += Delta;
- DesyncFix += Delta;
- if (Resim > 60.f)
- Resim = 60.f;
- if (Resim < -60.f)
- Resim = -60.f;
- }
- float Equalized;
- // if (fabs(g_Math.NormalizeYaw(oldEyeAngles[pEnt->EntIndex()].y - pEnt->GetEyeAngles().y)) < 60.f) // yea basically im retarded
- Equalized = g_Math.NormalizeYaw(pEnt->GetEyeAngles().y + Resim);
- // else
- // Equalized = g_Math.NormalizeYaw(pEnt->GetEyeAngles().y - Resim);
- if (g_Menu.Config.Resolver && !shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && (pEnt->GetFlags() & FL_ONGROUND))
- AnimState->m_flGoalFeetYaw = Equalized;
- } //b resolver?
- if (shot && pEnt != pLocalEnt && pEnt->GetTeam() != pLocalEnt->GetTeam() && PosParams[12] <= -80) // ez shot pitch fix LMAO
- PosParams[12] = 89.f;
- // Up There is The Original Resolver
- // In Order To Have A Good Anti Aim Resolver CounterMeasure
- // You Need To Know How Anti Aim Works
- // Of Course You Know How It Works Understand What These Codes Do
- // Then You Can Understand And Add Your Own Code To Your Desire
- // But Be Careful Adding Simple Conditions Or Same Conditions With Different Countermeasures
- // And Those That Are Positive And Negative Conditions As This Will Be On A Loop Resolver Which Is Not Good
- // So Make It Specific As Possible Like 2 Conditions To Be Sure
- // Also Keep A Eye On The Conditions If You Spotted Same Things As This Will Likely Be A Bad Resolver
- // 2nd Note: Make It Very Specific If You Want To Resolve Desync Statics Like I Do
- // 3rd Note 7/18/2019: Dont Make Your Resolver Overreact on Keeping It Resolving
- // 4rd Note: If You See Your Enemy Twitching Then Theres 2 Codes Overlapping
- if (g::missedshoted > 4)
- {
- int v19 = g::MissedShots[pEnt->EntIndex()] % 4;
- switch (v19)
- {
- case 0:
- player_animation_state->m_flGoalFeetYaw = player_animation_state->m_flGoalFeetYaw + 45.0;
- break;
- case 1:
- player_animation_state->m_flGoalFeetYaw = player_animation_state->m_flGoalFeetYaw - 45.0;
- break;
- case 2:
- player_animation_state->m_flGoalFeetYaw = player_animation_state->m_flGoalFeetYaw - 30.0;
- break;
- case 3:
- player_animation_state->m_flGoalFeetYaw = player_animation_state->m_flGoalFeetYaw + 30.0;
- break;
- default:
- return;
- }
- // g::MissedShots[pEnt->EntIndex()] = g::MissedShots[pEnt->EntIndex()] % 6; // so it just doesn't brute all the fucking time, that's dumb.
- }
- }
- void HandleHits(C_BaseEntity* pEnt)
- {
- auto NetChannel = g_pEngine->GetNetChannelInfo();
- if (!NetChannel)
- return;
- static float predTime[60];
- static bool init[60];
- if (g::Shot[pEnt->EntIndex()])
- {
- if (init[pEnt->EntIndex()])
- {
- g_Resolver.pitchHit[pEnt->EntIndex()] = pEnt->GetEyeAngles().x;
- predTime[pEnt->EntIndex()] = g_pGlobalVars->curtime + NetChannel->GetAvgLatency(FLOW_INCOMING) + NetChannel->GetAvgLatency(FLOW_OUTGOING) + TICKS_TO_TIME(1) + TICKS_TO_TIME(g_pEngine->GetNetChannel()->choked_packets);
- init[pEnt->EntIndex()] = false;
- }
- if (g_pGlobalVars->curtime > predTime[pEnt->EntIndex()] && !g::Hit[pEnt->EntIndex()])
- {
- g::MissedShots[pEnt->EntIndex()] += 1;
- g::Shot[pEnt->EntIndex()] = false;
- }
- else if (g_pGlobalVars->curtime <= predTime[pEnt->EntIndex()] && g::Hit[pEnt->EntIndex()])
- g::Shot[pEnt->EntIndex()] = false;
- }
- else
- init[pEnt->EntIndex()] = true;
- g::Hit[pEnt->EntIndex()] = false;
- }
- /*void HandleHits( C_BaseEntity * pEnt )
- {
- auto NetChannel = g_pEngine->GetNetChannelInfo( );
- if ( !NetChannel )
- return;
- static float predTime[ 65 ];
- static bool init[ 65 ];
- if ( g::Shot[ pEnt->EntIndex( ) ] )
- {
- if ( init[ pEnt->EntIndex( ) ] )
- {
- predTime[ pEnt->EntIndex( ) ] = g_pGlobalVars->curtime + NetChannel->GetAvgLatency( FLOW_INCOMING ) + NetChannel->GetAvgLatency( FLOW_OUTGOING ) + TICKS_TO_TIME( 1 ) + TICKS_TO_TIME( g_pEngine->GetNetChannel( )->choked_packets );
- init[ pEnt->EntIndex( ) ] = false;
- }
- if ( g_pGlobalVars->curtime > predTime[ pEnt->EntIndex( ) ] && !g::Hit[ pEnt->EntIndex( ) ] )
- {
- g::MissedShots[ pEnt->EntIndex( ) ] += 1;
- g::Shot[ pEnt->EntIndex( ) ] = false;
- }
- else if ( g_pGlobalVars->curtime <= predTime[ pEnt->EntIndex( ) ] && g::Hit[ pEnt->EntIndex( ) ] ) {
- g::Shot[ pEnt->EntIndex( ) ] = false; // missed shot due to spread (?) - no
- }
- }
- else
- init[ pEnt->EntIndex( ) ] = true;
- g::Hit[ pEnt->EntIndex( ) ] = false;
- } */
- inline float ClampYaw( float yaw )
- {
- while ( yaw > 180.f )
- yaw -= 360.f;
- while ( yaw < -180.f )
- yaw += 360.f;
- return yaw;
- }
- void Override( C_BaseEntity * pEnt )
- {
- if ( !g_Menu.Config.Resolver || !g_Menu.Config.ResolverOverride )
- return;
- if ( !GetAsyncKeyState( g_Menu.Config.override_resolver_key ) )
- return;
- if (!g::pLocalEntity || !g::pLocalEntity->IsAlive())
- return;
- Vector viewangles;
- g_pEngine->GetViewAngles( viewangles );
- auto at_target_yaw = g_Math.CalcAngle( pEnt->GetOrigin( ),
- g::pLocalEntity->GetOrigin( ) ).y;
- auto delta = ClampYaw( viewangles.y - at_target_yaw );
- if ( delta > 0 )
- pEnt->SetEyeAngles( Vector( pEnt->GetEyeAngles( ).x, at_target_yaw + 90, 0 ) );
- else
- pEnt->SetEyeAngles( Vector( pEnt->GetEyeAngles( ).x, at_target_yaw - 90, 0 ) );
- }
- void Resolver::FrameStage( ClientFrameStage_t stage )
- {
- if ( !g::pLocalEntity || !g_pEngine->IsInGame( ) || !g_pEngine->IsConnected( ) )
- return;
- if ( !g_Menu.Config.Resolver )
- return;
- if (!g_Menu.Config.Resolver2)
- return;
- if (!g_Menu.Config.Resolvertest)
- return;
- if (!g_Menu.Config.Resolve1)
- return;
- // if (!g_Menu.Config.Resolverfata)
- // return;
- //if (!g_Menu.Config.Resolverfata)
- // return;
- /*if (!g_Menu.Config.Resolver2)
- return; */
- for ( int i = 1; i < g_pEngine->GetMaxClients( ); ++i )
- {
- C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity( i );
- // IClientEntity* player;
- if ( !pPlayerEntity
- || !pPlayerEntity->IsAlive( ) )
- continue;
- if ( pPlayerEntity->IsDormant( ) ) {
- continue;
- }
- float yaw_value = 0;
- if (stage == FRAME_RENDER_START)
- {
- IClientEntity* player;
- C_BaseEntity* pLocalEnt;
- //Resolve1(pPlayerEntity, pLocalEnt);
- // Resolve(pPlayerEntity, player);
- HandleHits(pPlayerEntity);
- // AnimationFix(pPlayerEntity, pLocalEnt);
- //AnimationFix2(pPlayerEntity, pLocalEnt);
- //ResolverB(pPlayerEntity);
- AnimationFix(pPlayerEntity, pLocalEnt);
- }
- if (stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
- //if ( stage == FRAME_RENDER_START ) {
- // C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
- C_BaseEntity* pLocalEnt;
- IClientEntity* localplayer;
- IClientEntity* enemy;
- IClientEntity* player;
- //HandleHits( pPlayerEntity );
- Resolve( pPlayerEntity, pLocalEnt);
- //resolvepitch(pPlayerEntity);
- //resolve_mirror_primary(player, yaw_value, pPlayerEntity);
- //ResolverB(pPlayerEntity, player);
- //Resolve1(pPlayerEntity, pLocalEnt);
- // fatality(localplayer, enemy, pPlayerEntity);
- //AnimationFix(pPlayerEntity, pLocalEnt);
- // AnimationFix2(pPlayerEntity);
- //Resolve1(pPlayerEntity, pLocalEnt);
- }
- /*else if ( stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START ) {
- Override( pPlayerEntity );
- }*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement