SHARE
TWEET

Untitled

a guest Jul 20th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Resolver.h"
  2. #include "..\Aimbot\Aimbot.h"
  3. #include "..\Aimbot\Autowall.h"
  4. #include "..\Aimbot\LagComp.h"
  5. #include "..\..\Utils\Utils.h"
  6. #include "..\..\SDK\IVEngineClient.h"
  7. #include "..\..\SDK\Hitboxes.h"
  8. #include "..\..\SDK\PlayerInfo.h"
  9. #include "..\..\Utils\Math.h"
  10. #include "..\..\Menu\Menu.h"
  11. #include "..\..\SDK\IMemAlloc.h"
  12. #include "..\..\Utils\Interfaces.h""
  13. #include "..\AntiAim\Animations.h"
  14.  
  15. #define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
  16.  
  17.  
  18.  
  19. Resolver g_Resolver;
  20. IMemAlloc* uwuwuw = nullptr;
  21.  
  22.  
  23. float GetDesync(C_BaseEntity* target)
  24. {
  25.    
  26.     auto* animstate = target->AnimState();
  27.     float flRunningSpeed = clamp(animstate->m_flFeetSpeedForwardsOrSideWays, 0.f, 1.f);
  28.     float flYawModifier = ((animstate->m_flStopToFullRunningFraction * -0.3f) - 0.2f) * flRunningSpeed;
  29.     float flYawModifier2 = flYawModifier + 1.f;
  30.  
  31.     if (animstate->m_fDuckAmount > 0.f)
  32.     {
  33.         float maxVelocity = clamp(animstate->m_flFeetSpeedForwardsOrSideWays, 0.f, 1.f);
  34.         float duckSpeed = animstate->m_fDuckAmount * maxVelocity;
  35.         flYawModifier2 += (duckSpeed * (0.5f - flYawModifier2));
  36.     }
  37.  
  38.     return *(float*)((uintptr_t)animstate + 0x334) * flYawModifier2;
  39. }
  40.  
  41.  
  42. template <class T>
  43. constexpr const T& Max(const T& x, const T& y)
  44. {
  45.     return (x < y) ? y : x;
  46. }
  47.  
  48. Vector TraceToEnd(Vector start, Vector end)
  49. {
  50.     C_Trace trace;
  51.     CTraceWorldOnly* filter;
  52.    
  53.     g_pTrace->TraceRay(C_Ray(start, end), mask_all, filter, &trace);
  54.  
  55.     return trace.end;
  56. }
  57.  
  58.  
  59.  
  60. bool Resolver::AntiPener(C_BaseEntity* entity, float &yaw, int damage_tolerance)
  61. {
  62.  
  63.     Autowall* wall = nullptr;
  64.    
  65.  
  66.     if (!(entity->GetFlags() & FL_ONGROUND))
  67.         return false;
  68.  
  69.     auto local_player = g::pLocalEntity;
  70.     if (!local_player || local_player->GetLifeState() != 0)
  71.         return false;
  72.  
  73.  
  74.     if (!wall) return false;
  75.  
  76.     std::vector<C_BaseEntity*> enemies;
  77.  
  78.     const float height = 64;
  79.  
  80.     float leftdamage = 0.f, rightdamage = 0.f, backdamage = 0.f;
  81.  
  82.  
  83.     std::vector<Vector> last_eye_positions;
  84.  
  85.     last_eye_positions.insert(last_eye_positions.begin(), local_player->GetOrigin() + local_player->GetViewOffset());
  86.     if (last_eye_positions.size() > 128)
  87.         last_eye_positions.pop_back();
  88.  
  89.     auto nci = g_pEngine->GetNetChannelInfo();
  90.     if (!nci)
  91.         return false;
  92.  
  93.     const int latency_ticks = TIME_TO_TICKS(nci->GetLatency(FLOW_OUTGOING));
  94.     const auto latency_based_eye_pos = last_eye_positions.size() <= latency_ticks ? last_eye_positions.back() : last_eye_positions[latency_ticks];
  95.     float lpos = 0.f;
  96.  
  97.     Vector direction_1, direction_2, direction_3;
  98.     g_Math.AngleVectors(Vector(0.f, g_Math.CalcAngle(local_player->GetOrigin(), entity->GetOrigin()).y + 90.f, 0.f), &direction_1);
  99.     g_Math.AngleVectors(Vector(0.f, g_Math.CalcAngle(local_player->GetOrigin(), entity->GetOrigin()).y - 90.f, 0.f), &direction_2);
  100.     g_Math.AngleVectors(Vector(0.f, g_Math.CalcAngle(local_player->GetOrigin(), entity->GetOrigin()).y + 180.f, 0.f), &direction_3);
  101.  
  102.     const auto left_eye_pos = entity->GetOrigin() + Vector(0, 0, height) + (direction_1 * 16.f);
  103.     const auto right_eye_pos = entity->GetOrigin() + Vector(0, 0, height) + (direction_2 * 16.f);
  104.     const auto back_eye_pos = entity->GetOrigin() + Vector(0, 0, height) + (direction_3 * 16.f);
  105.  
  106.     leftdamage = wall->CanHitFloatingPoint(latency_based_eye_pos, left_eye_pos);
  107.     rightdamage = wall->CanHitFloatingPoint(latency_based_eye_pos, right_eye_pos);
  108.     backdamage = wall->CanHitFloatingPoint(latency_based_eye_pos, back_eye_pos);
  109.  
  110.  
  111.  
  112.     int right_damage = rightdamage;
  113.     int left_damage = leftdamage;
  114.     int back_damage = backdamage;
  115.  
  116.     float at_target_yaw = g_Math.CalcAngle(local_player->GetOrigin(), entity->GetOrigin()).y;
  117.     const float right_yaw = at_target_yaw - 90.f;
  118.     const float left_yaw = at_target_yaw + 90.f;
  119.     auto head_position = entity->GetOrigin() + Vector(0, 0, 64.f);
  120.  
  121.     float calculated_yaw;
  122.  
  123.     /// Find the lowest fov enemy
  124.     C_BaseEntity* closest_enemy = nullptr;
  125.     float lowest_fov = 360.f;
  126.     for (int i = 0; i <= 64; i++)
  127.     {
  128.         auto ent = g_pEntityList->GetClientEntity(i);
  129.         if (!ent || ent->IsDormant() || ent->GetTeam() == entity->GetTeam() || ent->GetHealth() <= 0 || !ent->IsAlive())
  130.             continue;
  131.  
  132.         const float current_fov = fabs(g_Math.NormalizeYaw(g_Math.CalcAngle(entity->GetOrigin(), ent->GetOrigin()).y - at_target_yaw));
  133.         if (current_fov < lowest_fov)
  134.         {
  135.             lowest_fov = current_fov;
  136.             closest_enemy = ent;
  137.         }
  138.  
  139.         enemies.push_back(ent);
  140.     }
  141.  
  142.     if (closest_enemy == nullptr)
  143.         return false;
  144.  
  145.     auto RotateAndExtendPosition = [](Vector position, float yaw, float distance) -> Vector
  146.     {
  147.         Vector direction;
  148.         g_Math.AngleVectors(Vector(0, yaw, 0), &direction);
  149.  
  150.         return position + (direction * distance);
  151.     };
  152.  
  153.     auto right_head_position = RotateAndExtendPosition(head_position, right_yaw, 16.f);
  154.     auto left_head_position = RotateAndExtendPosition(head_position, left_yaw, 16.f);
  155.  
  156.     auto CalcDamage = [wall, entity, enemies](Vector point) -> int
  157.     {
  158.         int damage = 0;
  159.         for (auto& enemy : enemies)
  160.         {
  161.             damage += Max<int>(wall->CanHitFloatingPoint(enemy->GetOrigin() + Vector(0, 0, 64.f), point),
  162.                 wall->CanHitFloatingPoint(enemy->GetOrigin() + Vector(0, 0, 64.f), point));
  163.         }
  164.  
  165.         return damage;
  166.     };
  167.  
  168.  
  169.     auto RotateLBYAndYaw = [right_yaw, left_yaw, entity](int right_damage, int left_damage, float& yaw, bool prefect_angle = false) -> bool
  170.     {
  171.         bool prefer_right = right_damage < left_damage;
  172.  
  173.         yaw = prefer_right ? right_yaw : left_yaw;
  174.  
  175.         /// If not moving
  176.         if (prefect_angle)
  177.             yaw = g_Math.GetLBYRotatedYaw(entity->GetLowerBodyYaw(), yaw);
  178.  
  179.         return true;
  180.     };
  181.  
  182.     if (left_damage >= damage_tolerance && right_damage >= damage_tolerance && back_damage >= damage_tolerance)
  183.         return false;
  184.  
  185.     if (left_damage >= damage_tolerance && right_damage >= damage_tolerance && back_damage < damage_tolerance)
  186.         calculated_yaw = at_target_yaw + 180.f;
  187.     else if (right_damage == left_damage)
  188.     {
  189.         if (g_Math.NormalizePitch(g_Math.CalcAngle(entity->GetOrigin(), local_player->GetOrigin()).x) > 15.f && back_damage < damage_tolerance)
  190.             calculated_yaw = at_target_yaw + 180.f;
  191.         else
  192.         {
  193.             right_head_position = RotateAndExtendPosition(head_position, right_yaw, 16.f);
  194.             left_head_position = RotateAndExtendPosition(head_position, left_yaw, 16.f);
  195.  
  196.             right_damage = CalcDamage(right_head_position), left_damage = CalcDamage(left_head_position);
  197.  
  198.             if (right_damage == left_damage)
  199.             {
  200.                 /// just return the side closest to a wall
  201.                 right_head_position = TraceToEnd(head_position, RotateAndExtendPosition(head_position, right_yaw, 16.f));
  202.                 left_head_position = TraceToEnd(head_position, RotateAndExtendPosition(head_position, left_yaw, 16.f));
  203.  
  204.                 float distance_1, distance_2;
  205.                 C_Trace trace;
  206.                 CTraceWorldOnly* filter;
  207.  
  208.                 auto end_pos = local_player->GetOrigin() + Vector(0, 0, 64.f);
  209.  
  210.                 /// right position
  211.                
  212.                 g_pTrace->TraceRay(C_Ray(right_head_position, end_pos), mask_all, filter, &trace);
  213.                 distance_1 = (right_head_position - trace.end).Length();
  214.  
  215.                 /// left position
  216.                 g_pTrace->TraceRay(C_Ray(left_head_position, end_pos), mask_all, filter, &trace);
  217.                 distance_2 = (left_head_position - trace.end).Length();
  218.  
  219.                 if (fabs(distance_1 - distance_2) > 15.f)
  220.                     RotateLBYAndYaw(distance_1, distance_2, calculated_yaw);
  221.                 else
  222.                     calculated_yaw = at_target_yaw + 180;
  223.             }
  224.             else
  225.                 RotateLBYAndYaw(right_damage, left_damage, calculated_yaw);
  226.         }
  227.     }
  228.     else
  229.     {
  230.         if (g_Math.NormalizePitch(g_Math.CalcAngle(entity->GetOrigin(), local_player->GetOrigin()).x) > 15.f && back_damage < damage_tolerance)
  231.             calculated_yaw = at_target_yaw + 180.f;
  232.         else
  233.         {
  234.             bool prefer_right = (right_damage < left_damage);
  235.             calculated_yaw = prefer_right ? right_yaw : left_yaw;
  236.         }
  237.     }
  238.  
  239.  
  240.  
  241.     yaw = calculated_yaw;
  242.  
  243.  
  244.  
  245.     return true;
  246. }
  247. //float m_flRunningSpeed = max(0, min(*reinterpret_cast<float*>(AnimationState + 0xF8), 1)); // excuse my cringy variable naming LOL
  248.  
  249. float Resolver::get_server_yaw()
  250. {
  251.  
  252.     auto AnimationState = g::pLocalEntity->AnimState();
  253.  
  254.     float ground_fraction = *(float*)(AnimationState + 0x11C);
  255.     float fDuckAmount = *(float*)(AnimationState + 0xA4);
  256.     float bDuckSpeed = max(0, min(1, *reinterpret_cast<float*> (AnimationState + 0xFC)));
  257.    
  258.    
  259.     auto backup_eflags = g::pLocalEntity->m_iEFlags();
  260.  
  261.     g::pLocalEntity->m_iEFlags() = (1 << 12);
  262.     Vector abs_velocity = g::pLocalEntity->m_vecAbsVelocity();
  263.     g::pLocalEntity->m_iEFlags() = backup_eflags;
  264.  
  265.     float speed = std::fmin(abs_velocity.Length(), 260.0f);
  266.  
  267.  
  268.     float goal_feet_yaw = AnimationState->m_flGoalFeetYaw;
  269.  
  270.     float eye_feet_delta = g_Math.AngleDiff(AnimationState->m_flEyeYaw, goal_feet_yaw);
  271.  
  272.  
  273.  
  274.     float flYawModifier = (((ground_fraction * -0.3f) - 0.2f) * bDuckSpeed) + 1.0f;
  275.  
  276.     if (fDuckAmount > 0.0f)
  277.         flYawModifier = flYawModifier + ((fDuckAmount * bDuckSpeed) * (0.5f - flYawModifier));
  278.  
  279.  
  280.     float flMaxYawModifier = flYawModifier * 58.f;
  281.     float flMinYawModifier = flYawModifier * -58.f;
  282.  
  283.     if (eye_feet_delta <= flMaxYawModifier)
  284.     {
  285.  
  286.  
  287.         if (flMinYawModifier > eye_feet_delta)
  288.             goal_feet_yaw = fabs(flMinYawModifier) + AnimationState->m_flEyeYaw;
  289.         else
  290.             goal_feet_yaw = AnimationState->m_flEyeYaw - fabs(flMaxYawModifier); //a
  291.     }
  292.  
  293.  
  294.     g_Math.NormalizeYaw(goal_feet_yaw);
  295.  
  296.     if (speed > 0.1f || fabs(abs_velocity.z) > 100.0f)
  297.     {
  298.         goal_feet_yaw = g_Math.ApproachAngle(
  299.             AnimationState->m_flEyeYaw,
  300.             goal_feet_yaw,
  301.             ((ground_fraction * 20.0f) + 30.0f)
  302.             * AnimationState->m_flLastClientSideAnimationUpdateTime);
  303.     }
  304.     else
  305.     {
  306.         goal_feet_yaw = g_Math.ApproachAngle(
  307.             g::pLocalEntity->GetLowerBodyYaw(),
  308.             goal_feet_yaw,
  309.             AnimationState->m_flLastClientSideAnimationUpdateTime * 100.0f);
  310.     }
  311.  
  312.     return g_Math.NormalizeYaw(goal_feet_yaw);
  313. }
  314.  
  315.  
  316. float Resolver::GetEntityAbsYaw(C_BaseEntity* entity)
  317. {
  318.     auto* animstate = entity->GetPlayerAnimationState();
  319.     float v94;
  320.     float ground_fraction = *(float *)(animstate + 0x11C);
  321.     float duck_ammount = *(float *)(animstate + 0xA4);
  322.     float ducking_speed = max(0, min(1, *reinterpret_cast<float*> (animstate + 0xFC)));
  323.     float running_speed = max(0, min(*reinterpret_cast<float*>(animstate + 0xF8), 1));
  324.     int backup_eflags = entity->m_iEFlags();
  325.  
  326.     //credits: tommy and denishack
  327.     entity->SetFlags((1 << 12));
  328.     Vector abs_velocity = entity->m_vecAbsVelocity();
  329.     entity->m_iEFlags() = backup_eflags;
  330.  
  331.     float speed = std::fmin(abs_velocity.Length(), 260.0f);
  332.  
  333.  
  334.     float goal_feet_yaw = animstate->goal_feet_yaw;
  335.  
  336.     float eye_feet_delta = g_Math.angle_diff(animstate->eye_angles_y, goal_feet_yaw);
  337.  
  338.  
  339.  
  340.     float flYawModifier = (((ground_fraction * -0.3f) - 0.2f) * running_speed) + 1.0f;
  341.  
  342.     if (duck_ammount > 0.0f)
  343.         flYawModifier = flYawModifier + ((duck_ammount * ducking_speed) * (0.5f - flYawModifier));
  344.  
  345.  
  346.     float flMaxYawModifier = flYawModifier * 58.f;
  347.     float flMinYawModifier = flYawModifier * -58.f;
  348.  
  349.     if (eye_feet_delta <= flMaxYawModifier)
  350.         if (flMinYawModifier > eye_feet_delta)
  351.             goal_feet_yaw = fabs(flMinYawModifier) + animstate->eye_angles_y;
  352.  
  353.         else
  354.             goal_feet_yaw = animstate->eye_angles_y - fabs(flMaxYawModifier);
  355.  
  356.  
  357.     g_Math.NormalizeYaw(goal_feet_yaw);
  358.  
  359.     if (speed > 0.1f || fabs(abs_velocity.z) > 100.0f)
  360.     {
  361.         goal_feet_yaw = g_Math.fl_approach_angle(
  362.             animstate->eye_angles_y,
  363.             goal_feet_yaw,
  364.             ((ground_fraction * 20.0f) + 30.0f)
  365.             * animstate->last_client_side_animation_update_time);
  366.     }
  367.     else
  368.     {
  369.         goal_feet_yaw = g_Math.fl_approach_angle(
  370.             entity->GetLowerBodyYaw(),
  371.             goal_feet_yaw,
  372.             animstate->last_client_side_animation_update_time * 100.0f);
  373.     }
  374.  
  375.     g_Math.NormalizeYaw(goal_feet_yaw);
  376.  
  377.     v94 = goal_feet_yaw;
  378.  
  379.     return v94;
  380. }
  381.  
  382.  
  383.  
  384. void Resolver::AnimationFix(C_BaseEntity* pEnt)
  385. {
  386.     if (!g::pLocalEntity->IsAlive())
  387.         & CAnimations::LocalPlayerAnimfix;
  388.     *reinterpret_cast<int*>(uintptr_t(pEnt) + 0xA30) = g_pGlobalVars->framecount;
  389.     *reinterpret_cast<int*>(uintptr_t(pEnt) + 0xA28) = 0;
  390. }
  391.  
  392.  
  393.  
  394.  
  395.  
  396. void HandleHits(C_BaseEntity* pEnt)
  397. {
  398.     auto NetChannel = g_pEngine->GetNetChannelInfo();
  399.  
  400.     if (!NetChannel)
  401.         return;
  402.  
  403.     static float predTime[65];
  404.     static bool init[65];
  405.  
  406.     if (g::Shot[pEnt->EntIndex()])
  407.     {
  408.         if (init[pEnt->EntIndex()])
  409.         {
  410.             g_Resolver.pitchHit[pEnt->EntIndex()] = pEnt->GetEyeAngles().x;
  411.             predTime[pEnt->EntIndex()] = g_pGlobalVars->curtime + NetChannel->GetAvgLatency(FLOW_INCOMING) + NetChannel->GetAvgLatency(FLOW_OUTGOING) + TICKS_TO_TIME(1) + TICKS_TO_TIME(g_pEngine->GetNetChannel()->m_nChokedPackets);
  412.             init[pEnt->EntIndex()] = false;
  413.         }
  414.  
  415.         if (g_pGlobalVars->curtime > predTime[pEnt->EntIndex()] && !g::Hit[pEnt->EntIndex()])
  416.         {
  417.             g::MissedShots[pEnt->EntIndex()] += 1;
  418.             g::Shot[pEnt->EntIndex()] = false;
  419.         }
  420.         else if (g_pGlobalVars->curtime <= predTime[pEnt->EntIndex()] && g::Hit[pEnt->EntIndex()])
  421.             g::Shot[pEnt->EntIndex()] = false;
  422.  
  423.     }
  424.     else
  425.         init[pEnt->EntIndex()] = true;
  426.  
  427.     g::Hit[pEnt->EntIndex()] = false;
  428. }
  429.  
  430.  
  431. void Resolver::OnCreateMove() // cancer v2
  432. {
  433.     if (!g_Menu.Config.Resolver)
  434.         return;
  435.  
  436.     if (!g::pLocalEntity->IsAlive())
  437.         return;
  438.  
  439.     if (!g::pLocalEntity->GetActiveWeapon() || g::pLocalEntity->IsKnifeorNade())
  440.         return;
  441. }
  442.  
  443.  
  444. C_BaseEntity* UTIL_PlayerByIndex(int index)
  445. {
  446.     typedef C_BaseEntity*(__fastcall* PlayerByIndex)(int);
  447.     static PlayerByIndex UTIL_PlayerByIndex = (PlayerByIndex)Utils::FindSignature("server.dll", "85 C9 7E 2A A1");
  448.  
  449.     if (!UTIL_PlayerByIndex)
  450.         return false;
  451.  
  452.     return UTIL_PlayerByIndex(index);
  453. }
  454.  
  455. float GetLBYRotatedYaw(float lby, float yaw)
  456. {
  457.     float delta = g_Math.NormalizeYaw(yaw - lby);
  458.     if (fabs(delta) < 25.f)
  459.         return lby;
  460.  
  461.     if (delta > 0.f)
  462.         return yaw + 25.f;
  463.  
  464.     return yaw;
  465. }
  466.  
  467.  
  468. void Resolver::FrameStage(ClientFrameStage_t stage)
  469. {
  470.     if (!g::pLocalEntity || !g_pEngine->IsInGame())
  471.         return;
  472.  
  473.     static bool  wasDormant[65];
  474.  
  475.     for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
  476.     {
  477.         C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(i);
  478.  
  479.         if (!pPlayerEntity || pPlayerEntity == g::pLocalEntity || pPlayerEntity->GetTeam() == g::pLocalEntity->GetTeam())
  480.             continue;
  481.  
  482.         if (pPlayerEntity->IsDormant())
  483.         {
  484.             wasDormant[i] = true;
  485.             continue;
  486.         }
  487.  
  488.  
  489.  
  490.         if (stage == FRAME_NET_UPDATE_END)
  491.         {
  492.             static bool flip;
  493.             flip = !flip;
  494.             int index = pPlayerEntity->EntIndex();
  495.  
  496.  
  497.            
  498.  
  499.             auto* animstate = pPlayerEntity->AnimState();
  500.             if (!animstate) return;
  501.  
  502.             auto delta = std::remainderf(animstate->m_flGoalFeetYaw, 360.f) - pPlayerEntity->GetLowerBodyYaw();
  503.             float resolved_angle = pPlayerEntity->GetEyeAnglesPointer()->y + delta < 0.f ? delta : -delta;
  504.  
  505.             int missed[65];
  506.             missed[pPlayerEntity->EntIndex()] = g::shots_fired[pPlayerEntity->EntIndex()] - g::shots_hit[index]; // getting missed shots
  507.  
  508.             float relative = g_Math.CalcAngle(pPlayerEntity->GetOrigin(), g::pLocalEntity->GetOrigin()).y;
  509.  
  510.             ///lawliet being autistic
  511.             //if (g_Aimbot.ShotBacktrack[index] || g_Aimbot.Backtrack[index] || pPlayerEntity->GetVelocity().Length2D() > 0.1) return; //if bt or move
  512.  
  513.             if (g_Menu.Config.Resolver)
  514.             {
  515.                 //leaving this in because its garbage anyways
  516.                 if (missed[pPlayerEntity->EntIndex() > 1])
  517.                 {
  518.                     switch (missed[pPlayerEntity->EntIndex()] % 4)
  519.                     {
  520.                     case 2:
  521.                         pPlayerEntity->GetEyeAnglesPointer()->y += pPlayerEntity->max_desync(); break;
  522.                     case 3:
  523.                         pPlayerEntity->GetEyeAnglesPointer()->y -= pPlayerEntity->max_desync(); break;
  524.                     case 4:
  525.                         pPlayerEntity->GetEyeAnglesPointer()->y += pPlayerEntity->max_desync() * 2; break; // aimware max desync is 116 so uh idk
  526.                     case 5:
  527.                         pPlayerEntity->GetEyeAnglesPointer()->y -= pPlayerEntity->max_desync() * 2; break;
  528.                     }
  529.                 }
  530.                 else
  531.                 {
  532.                     float lby_delta = 0;
  533.                     lby_delta = std::remainderf(lby_delta, 360.f);
  534.                     lby_delta = clamp(lby_delta, -60.f, 60.f);
  535.  
  536.                     float feet_yaw = std::remainderf(pPlayerEntity->GetEyeAngles().y + lby_delta, 360.f);
  537.  
  538.                     if (feet_yaw < 0.f)
  539.                         feet_yaw += 360.f;
  540.  
  541.                     animstate->m_flGoalFeetYaw = feet_yaw;
  542.  
  543.  
  544.                     if (g_Math.YawDistance(pPlayerEntity->AnimState()->m_flGoalFeetYaw, animstate->m_flGoalFeetYaw + pPlayerEntity->max_desync()) < pPlayerEntity->max_desync())
  545.                     {
  546.                         switch (missed[pPlayerEntity->EntIndex()])
  547.                         {
  548.                         case 0:
  549.                             pPlayerEntity->AnimState()->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - pPlayerEntity->max_desync(); break;
  550.                         case 1:
  551.                             pPlayerEntity->AnimState()->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + pPlayerEntity->max_desync(); break;
  552.                         }
  553.                    
  554.  
  555.                     }
  556.                     else
  557.                     {
  558.                         switch (missed[pPlayerEntity->EntIndex()])
  559.                         {
  560.                         case 0:
  561.                             pPlayerEntity->AnimState()->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + pPlayerEntity->max_desync(); break;
  562.                         case 1:
  563.                             pPlayerEntity->AnimState()->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - pPlayerEntity->max_desync(); break;
  564.                         }
  565.                     }
  566.                 }
  567.             }
  568.         }
  569.         wasDormant[i] = false;
  570.     }
  571. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top