Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. void animationfix(SDK::CBaseEntity* player)
  2. {
  3.  
  4. if (player == nullptr)
  5. return;
  6.  
  7. if (!player->is_self_animating())
  8. return;
  9.  
  10. int v6; // ecx
  11. int v7; // eax
  12. int v8; // edi
  13. int v9; // ecx
  14. int simTime; // ebx
  15. char v13; // [esp+10h] [ebp-348h]
  16. const float curtime = INTERFACES::Globals->curtime;
  17.  
  18. const float frametime = INTERFACES::Globals->frametime;
  19.  
  20.  
  21. simTime = player->GetSimTime();
  22.  
  23. auto GetClientSideAnimation = player->GetClientSideAnimation();
  24.  
  25. *GetClientSideAnimation = true;
  26.  
  27. INTERFACES::Globals->frametime = INTERFACES::Globals->interval_per_tick;
  28. INTERFACES::Globals->curtime = player->GetSimTime();
  29. LagRecord records = timesim->CreateRecord(player);
  30. auto state = player->GetAnimState();
  31. auto old_ragpos = player->get_ragdoll_pos();
  32.  
  33. auto &tracks = timesim->m_PlayerTracks[player->GetIndex() - 1];
  34. if (state)
  35. {
  36. v7 = INTERFACES::Globals->framecount;
  37. if (state)
  38. state->m_iLastClientSideAnimationUpdateFramecount = INTERFACES::Globals->framecount - 1;
  39.  
  40. v8 = player->GetFlags();
  41. v9 = records.m_fFlags;
  42. *player->GetFlags2() = v9;
  43.  
  44. if (tracks.size() > 2)
  45. {
  46. if ((player->GetSimTime() - tracks.at(2).first.m_flSimulationTime) > 1)
  47. {
  48.  
  49. *player->GetFlags2() &= 0xFFFFFFFE;
  50. }
  51. }
  52.  
  53. if (v9 & 1
  54. && !(records.m_fFlags & 1)
  55. && (((player->GetSimTime() - records.m_flSimulationTime) / INTERFACES::Globals->interval_per_tick) + 0.5) > 2)
  56. {
  57. *player->GetFlags2() = v9 & 0xFFFFFFFE;
  58. }
  59. }
  60.  
  61. //AddBaseAnimatingInterpolatedVars(player);
  62.  
  63. //ClientSideAnimationChanged(player);
  64.  
  65. //UpdateClientSideAnimations(player);
  66.  
  67. player->get_ragdoll_pos() = old_ragpos;
  68. player->UpdateClientSideAnimation();
  69.  
  70. INTERFACES::Globals->curtime = curtime;
  71. INTERFACES::Globals->frametime = frametime;
  72.  
  73. //player->SetAbsAngles(Vector(0.f, player->GetAnimState()->m_flGoalFeetYaw, 0.f));
  74.  
  75. *GetClientSideAnimation = false;
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement