Advertisement
Guest User

mellowresolver2

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