SHARE
TWEET

Untitled

a guest Aug 17th, 2019 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. void angle_correction::resolve_mirror_primary(IClientEntity * player)
  3. {
  4.  
  5.     float moving_lby[65] = { FLT_MAX };
  6.     float delta[65] = { FLT_MAX };
  7.     float old_lby[65] = { FLT_MAX };
  8.     float update_time[65] = { FLT_MAX };
  9.     float original_lby[65] = { FLT_MAX };
  10.     bool lby_flick[65] = { false };
  11.     bool fake = false;
  12.     bool did_move[65] = { false };
  13.  
  14.     bool is_moving = player->getvelocity().Length2D() > 0.1f && (player->GetFlags() & FL_ONGROUND);
  15.  
  16.     const auto animation = player->get_animation_state();
  17.  
  18.     if (!animation)
  19.         return;
  20.  
  21.     if (player->get_choked_ticks() < 1)
  22.         return;
  23.  
  24.     if ((!delta_35(player->GetEyeAnglesXY()->y, player->GetLowerBodyYaw()) && Globals::missedshots[player->GetIndex()] > 3))
  25.     {
  26.         resolver->enemy_fake[player->GetIndex()] = true;
  27.         fake = true;
  28.     }
  29.     else
  30.     {
  31.         resolver->enemy_fake[player->GetIndex()] = false;
  32.         fake = false;
  33.     }
  34.  
  35.     if (delta_35(player->GetEyeAnglesXY()->y, player->GetLowerBodyYaw()) && ragebot->valid_hitchance && player->getvelocity().Length2D())
  36.     {
  37.         resolver->has_desync[player->GetIndex()] = true;
  38.     }
  39.     else
  40.         resolver->has_desync[player->GetIndex()] = false;
  41.  
  42.     if (is_moving)
  43.     {
  44.         if (moving_lby[player->GetIndex()] != player->GetLowerBodyYaw())
  45.             moving_lby[player->GetIndex()] = player->GetLowerBodyYaw();
  46.  
  47.         old_lby[player->GetIndex()] = player->GetLowerBodyYaw();
  48.         did_move[player->GetIndex()] = true;
  49.     }
  50.  
  51.  
  52.     if (player->getvelocity().Length2D() < 1.1f && (player->GetFlags() & FL_ONGROUND))
  53.     {
  54.         if (original_lby[player->GetIndex()] == FLT_MAX)
  55.         {
  56.             original_lby[player->GetIndex()] = player->GetLowerBodyYaw();
  57.         }
  58.  
  59.         if (old_lby[player->GetIndex()] != player->GetLowerBodyYaw())
  60.         {
  61.             delta[player->GetIndex()] = old_lby[player->GetIndex()] - player->GetLowerBodyYaw();
  62.             lby_flick[player->GetIndex()] = true;
  63.             old_lby[player->GetIndex()] = player->GetLowerBodyYaw();
  64.         }
  65.     }
  66.     else
  67.     {
  68.         if (original_lby[player->GetIndex()] != player->GetLowerBodyYaw())
  69.             original_lby[player->GetIndex()] = player->GetLowerBodyYaw();
  70.     }
  71.  
  72. #pragma region i want to die.
  73.  
  74.     if (player->getvelocity().Length2D() < 1.1f && (delta[player->GetIndex()] < 160 && delta[player->GetIndex()] > -160))
  75.     {
  76.         if (breaking_lby_animations(player))
  77.         {
  78.             if (lby_flick[player->GetIndex()])
  79.             {
  80.                 player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
  81.             }
  82.  
  83.             if (Globals::missedshots[player->GetIndex()] < 2)
  84.             {
  85.                 player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw() - delta[player->GetIndex()];
  86.             }
  87.  
  88.             else
  89.             {
  90.                 player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
  91.             }
  92.         }
  93.  
  94.         else if (solve_desync_simple(player)) // experimental. Low delta lby break related animations.
  95.         {  
  96.         //  if ((delta[player->GetIndex()] < 120.f && delta[player->GetIndex()] >= 90.f) || (delta[player->GetIndex()] > -120.f && delta[player->GetIndex()] <= -90.f))
  97.             {
  98.                 if (Globals::missedshots[player->GetIndex()] < 2)
  99.                 {
  100.                     player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
  101.                 }
  102.  
  103.                 if (Globals::missedshots[player->GetIndex()] >= 2)
  104.                 {
  105.                     player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw() - delta[player->GetIndex()];
  106.                 }
  107.             }
  108. /*
  109.             else
  110.             {
  111.                 switch (Globals::missedshots[player->GetIndex()])
  112.                 {
  113.                     //skip the first
  114.                 case 1: player->GetEyeAnglesXY()->y -= 30.f;
  115.                     break;
  116.                 case 2: player->GetEyeAnglesXY()->y += 50.f;
  117.                     break;
  118.                 case 3: player->GetEyeAnglesXY()->y -= 29.f;
  119.                     break;
  120.                 case 4: player->GetEyeAnglesXY()->y -= delta[player->GetIndex()];
  121.                     break;
  122.                 case 5: player->GetEyeAnglesXY()->y -= 50.f;
  123.                     break;
  124.                     // skip the sixth
  125.                 }
  126.             }
  127. */
  128.         }
  129.        
  130.         else
  131.         {
  132.             switch (Globals::missedshots[player->GetIndex()])
  133.             {
  134.                 //skip the first
  135.             case 1: player->GetEyeAnglesXY()->y -= 29.f;
  136.                 break;
  137.             case 2: player->GetEyeAnglesXY()->y += 50.f;
  138.                 break;
  139.             case 3: player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
  140.                 break;
  141.             case 4: player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw() - 110.f;
  142.                 break;
  143.             case 5: player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw() + 30.f;
  144.                 break;
  145.             case 6:  player->GetEyeAnglesXY()->y -= 40.f;
  146.                 break;
  147.             }
  148.         }
  149.     }
  150.  
  151.     else
  152.     {
  153.  
  154.         for (size_t i = 0; i < player->GetNumAnimOverlays(); i++)
  155.         {
  156.             auto layer = player->get_anim_overlay_index(i);
  157.  
  158.             if (!layer)
  159.                 continue;
  160.  
  161.             if (player->get_sequence_act(layer->m_nSequence) == 979 && player->get_sequence_act(layer->m_nSequence) != 981)
  162.             {
  163.                 player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw() - (player->GetLowerBodyYaw() - old_lby[player->GetIndex()]) + (Globals::missedshots[player->GetIndex()] < 2 ? 20 : -20.f);
  164.             }
  165.             else
  166.             {
  167.                 switch (Globals::missedshots[player->GetIndex()] % 7)
  168.                 {
  169.                 case 0: player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw();
  170.                     break;
  171.                 case 1: player->GetEyeAnglesXY()->y -= 34.f;
  172.                     break;
  173.                 case 2: player->GetEyeAnglesXY()->y += 40.f;
  174.                     break;
  175.                 case 3: player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw() - 19;
  176.                     break;
  177.                 case 4: player->GetEyeAnglesXY()->y -= max_delta(player, animation);
  178.                     break;
  179.                 case 5: player->GetEyeAnglesXY()->y += 30.f;
  180.                     break;
  181.                 case 6: player->GetEyeAnglesXY()->y -= 20.f;
  182.                     break;
  183.                 case 7:  player->GetEyeAnglesXY()->y -= 35.f;
  184.                     break;
  185.             //  default: player->GetEyeAnglesXY()->y = player->GetLowerBodyYaw(); // because when moving, the :b:sync is based off lby
  186.                 }
  187.             }
  188.         }
  189.        
  190.     }
  191.  
  192. }
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