Advertisement
Guest User

Untitled

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