Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.79 KB | None | 0 0
  1. void Resolver::Resolve(ClientFrameStage_t stage, C_BaseEntity* pEnt)
  2. {
  3.     if (!g_menu.config.aimbot.Resolver) {
  4.  
  5.     if (!g::local->IsAlive())
  6.         return;
  7.  
  8.     if (pEnt->GetTeam() == g::local->GetTeam())
  9.         return;
  10.  
  11.  
  12.     auto animstate = pEnt->AnimState();
  13.  
  14.     const auto player_animation_state = pEnt->AnimState();
  15.  
  16.  
  17.     float flMaxYawModifier = player_animation_state->pad10[516] * flMaxYawModifier;
  18.     float flMinYawModifier = player_animation_state->pad10[512] * flMaxYawModifier;
  19.  
  20.     float newFeetYaw = 1.f;
  21.  
  22.     auto eyeYaw = player_animation_state->m_flEyeYaw;
  23.  
  24.     auto lbyYaw = player_animation_state->m_flGoalFeetYaw;
  25.  
  26.     float eye_feet_delta = fabs(eyeYaw - lbyYaw);
  27.  
  28.  
  29.     if (!player_animation_state)
  30.         return;
  31.  
  32.  
  33.  
  34.     float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);
  35.  
  36.     auto v28 = 0.f;
  37.  
  38.     if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
  39.     {
  40.         v28 = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 0.0f);
  41.     }
  42.     else
  43.     {
  44.         v28 = 0x3F800000;
  45.     }
  46.  
  47.     float v49 = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v49;
  48.  
  49.     float flYawModifier = v49 + 1.0;
  50.  
  51.     if (player_animation_state->m_fDuckAmount > 0.0)
  52.     {
  53.         float v53 = 0.0f;
  54.  
  55.         if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
  56.         {
  57.             v53 = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
  58.         }
  59.         else
  60.         {
  61.             v53 = 0.0f;
  62.         }
  63.     }
  64.  
  65.  
  66.  
  67.  
  68.  
  69.     if (eye_feet_delta <= flMaxYawModifier)
  70.     {
  71.         if (flMinYawModifier > eye_feet_delta)
  72.         {
  73.             newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
  74.         }
  75.     }
  76.     else
  77.     {
  78.         newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
  79.     }
  80.  
  81.  
  82.  
  83.  
  84.     float v136 = fmod(newFeetYaw, 360.0);
  85.  
  86.     if (v136 > 180.0)
  87.     {
  88.         v136 = v136 - 360.0;
  89.     }
  90.  
  91.     if (v136 < 180.0)
  92.     {
  93.         v136 = v136 + 360.0;
  94.     }
  95.  
  96.     v28 = v49++;
  97.  
  98.     {                                             // inlined max_desync_delta
  99.         float v9 = fabs(animstate->m_iLastClientSideAnimationUpdateFramecount - animstate->m_flLastClientSideAnimationUpdateTime);
  100.         float speedfraction = 0.0;
  101.         if (animstate->m_flFeetSpeedForwardsOrSideWays < 0.0)
  102.             speedfraction = 0.0;
  103.         else
  104.             speedfraction = animstate->m_flFeetSpeedForwardsOrSideWays;
  105.  
  106.         float v2 = (animstate->m_flStopToFullRunningFraction * -0.30000001 - 0.19999999) * speedfraction;
  107.         float v18 = v2;
  108.         float v3 = v2 + 1.0;
  109.         float v23 = v3;
  110.         if (animstate->m_fDuckAmount > 0.0)
  111.         {
  112.             float v29 = 0.0;
  113.             if (animstate->m_flFeetSpeedUnknownForwardOrSideways < 0.0)
  114.                 v29 = 0.0;
  115.             else
  116.                 v29 = fminf((animstate->m_flFeetSpeedUnknownForwardOrSideways), 0x3F800000);
  117.         }
  118.  
  119.         if (g::local)
  120.         {
  121.             for (int i = 1; i < g_pEngine->GetMaxClients(); ++i)
  122.             {
  123.  
  124.                 if (pEnt)// dormant
  125.                 {
  126.                     float v28 = pEnt->GetEyeAngles().y == 0.0 ? -58 : 58;
  127.                     if (v28)
  128.                         return;
  129.                     float v27 = pEnt->GetEyeAngles().y == 0.0 ? -89 : 89;
  130.                     if (v27)
  131.                         return;
  132.                     float v26 = pEnt->GetEyeAngles().y == 0.0 ? -79 : 79;
  133.                     if (v26)
  134.                         return;
  135.                     float v25 = pEnt->GetEyeAngles().y == 0.0 ? -125 : 125;
  136.                     if (v25)
  137.                         return;
  138.                     float v24 = pEnt->GetEyeAngles().y == 0.0 ? -78 : 78;
  139.                     if (v24)
  140.                         return;
  141.                 }
  142.                 float v8 = 0;
  143.                 float v7 = 0;
  144.                 float v6 = 0;
  145.                 for (size_t i = 0; i < pEnt->GetNumAnimOverlays(); i++)
  146.                 {
  147.                     auto layer = pEnt->GetNumAnimOverlays();
  148.                     if (!layer)
  149.                         continue;
  150.  
  151.  
  152.  
  153.                     v6 = pEnt->GetLowerBodyYaw();
  154.                 }
  155.                 float v20 = (animstate->m_vVelocityX) * v23;
  156.                 float a1 = (animstate->m_vVelocityY) * v23;
  157.                 float v30 = 0.0;
  158.                 float eye_angles_y = animstate->m_flEyeYaw;
  159.                 float goal_feet_yaw = animstate->m_flGoalFeetYaw;
  160.                 float v22 = fabs(eye_angles_y - goal_feet_yaw);
  161.                 if (v20 < v22)
  162.                 {
  163.                     float v11 = fabs(v20);
  164.                     v30 = eye_angles_y - v11;
  165.                 }
  166.                 else if (a1 > v22)
  167.                 {
  168.                     float v12 = fabs(a1);
  169.                     v30 = v12 + eye_angles_y;
  170.                 }
  171.                 float v36 = std::fmodf((v30), 360.0);
  172.                 if (v36 > 180.0)
  173.                     v36 = v36 - 360.0;
  174.                 if (v36 < 180.0)
  175.                     v36 = v36 + 360.0;
  176.                 animstate->m_flGoalFeetYaw = v36;
  177.                 if (g::MissedShots[pEnt->EntIndex()] > 2)
  178.                 {
  179.                     int v19 = g::MissedShots[pEnt->EntIndex()] % 4;
  180.                     switch (v19)
  181.                     {
  182.                     case 0:
  183.                         animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 45.0;
  184.                         break;
  185.                     case 1:
  186.                         animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 45.0;
  187.                         break;
  188.                     case 2:
  189.                         animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw - 30.0;
  190.                         break;
  191.                     case 3:
  192.                         animstate->m_flGoalFeetYaw = animstate->m_flGoalFeetYaw + 30.0;
  193.                         break;
  194.                     default:
  195.                         return;
  196.  
  197.  
  198.  
  199.  
  200.                         player_animation_state->m_flGoalFeetYaw = v136;
  201.                     }
  202.                 }
  203.             }
  204.  
  205.         }
  206.     }
  207.    
  208. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement