Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. static auto r_jiggle_bones = INTERFACES::cvar->FindVar("r_jiggle_bones");
  2.  
  3. auto animstate = GetAnimState();
  4.  
  5. //fixvelocity
  6. animstate->m_vVelocityX = 0.f;
  7. animstate->m_vVelocityY = 0.f;
  8. animstate->speed_2d = 0.001f; // 0.0 will break more than fix so use 0.001 or just hook this field
  9.  
  10. auto parent_cvar = r_jiggle_bones->pParent;
  11. if (parent_cvar == r_jiggle_bones)
  12. parent_cvar = 0;
  13. else
  14. parent_cvar = 1;
  15.  
  16. // fixing goal feet yaw for better interpolating bones
  17. animstate->m_flGoalFeetYaw = this->GetLowerBodyYaw() + animstate->m_flMaxBodyYaw;
  18.  
  19. auto pOverlay = this->GetAnimOverlay(6);
  20.  
  21. //adjust the value to correctly calculate the position of the bones
  22. pOverlay->m_flWeight = pOverlay->m_flCycle = pOverlay->m_flPlaybackRate = 0.f;
  23.  
  24. if (pOverlay->m_Sequence > 0)
  25. pOverlay->m_Sequence += 1; // Fixing sequence delay before setup bones calc
  26.  
  27. //skip extrapolating velocity
  28. m_bHasDefuser() = false;
  29. this->GetVelocity() = this->EstimateAbsVelocity() * animstate->m_flUnknownVelocityLean;
  30.  
  31. //trigger lby update
  32. m_nSequence() = 979;
  33. animstate->m_flLastBodyUpdate = INTERFACES::Globals->curtime + 1.32f; // set new body yaw update with delay
  34.  
  35. *(int*)(((uintptr_t)this) + 0xA30) = 0;
  36.  
  37. auto v5 = *(int*)(((uintptr_t)this) + 0xF0);
  38. *(int*)(((uintptr_t)this) + 0xF0) |= 8u;
  39. auto v6 = *(uint8_t*)(((uintptr_t)this) + 0x274);
  40. *(uint8_t*)(((uintptr_t)this) + 0x274) &= 0xFEu;
  41. *(int*)(INTERFACES::Globals + 0x001C) = -1; // fix interpolation
  42. *(bool*)(((uintptr_t)this) + 0xF3C) = true; // SetupVelocity call for calculation right angles
  43.  
  44. // ref: DoExtraBonesProcessing
  45. (*(BYTE*)(uintptr_t(this) + 0xA28)) |= 0xE;
  46. *(short*)(uintptr_t(this) + 0x272) = -1;
  47.  
  48. int result = 1;
  49. __asm push 0x54f12f43
  50. this->SetupBones(0, -1, BONE_USED_BY_ANYTHING, INTERFACES::Globals->curtime);
  51. __asm pop result
  52.  
  53. this->GetVelocity() = this->EstimateAbsVelocity(); // restore velocity
  54.  
  55. *(uint8_t*)(((uintptr_t)this) + 0x274) = v6;
  56. *(int*)(((uintptr_t)this) + 0xF0) = v5;
  57.  
  58. r_jiggle_bones->SetValue(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement