Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static auto r_jiggle_bones = INTERFACES::cvar->FindVar("r_jiggle_bones");
- auto animstate = GetAnimState();
- //fixvelocity
- animstate->m_vVelocityX = 0.f;
- animstate->m_vVelocityY = 0.f;
- animstate->speed_2d = 0.001f; // 0.0 will break more than fix so use 0.001 or just hook this field
- auto parent_cvar = r_jiggle_bones->pParent;
- if (parent_cvar == r_jiggle_bones)
- parent_cvar = 0;
- else
- parent_cvar = 1;
- // fixing goal feet yaw for better interpolating bones
- animstate->m_flGoalFeetYaw = this->GetLowerBodyYaw() + animstate->m_flMaxBodyYaw;
- auto pOverlay = this->GetAnimOverlay(6);
- //adjust the value to correctly calculate the position of the bones
- pOverlay->m_flWeight = pOverlay->m_flCycle = pOverlay->m_flPlaybackRate = 0.f;
- if (pOverlay->m_Sequence > 0)
- pOverlay->m_Sequence += 1; // Fixing sequence delay before setup bones calc
- //skip extrapolating velocity
- m_bHasDefuser() = false;
- this->GetVelocity() = this->EstimateAbsVelocity() * animstate->m_flUnknownVelocityLean;
- //trigger lby update
- m_nSequence() = 979;
- animstate->m_flLastBodyUpdate = INTERFACES::Globals->curtime + 1.32f; // set new body yaw update with delay
- *(int*)(((uintptr_t)this) + 0xA30) = 0;
- auto v5 = *(int*)(((uintptr_t)this) + 0xF0);
- *(int*)(((uintptr_t)this) + 0xF0) |= 8u;
- auto v6 = *(uint8_t*)(((uintptr_t)this) + 0x274);
- *(uint8_t*)(((uintptr_t)this) + 0x274) &= 0xFEu;
- *(int*)(INTERFACES::Globals + 0x001C) = -1; // fix interpolation
- *(bool*)(((uintptr_t)this) + 0xF3C) = true; // SetupVelocity call for calculation right angles
- // ref: DoExtraBonesProcessing
- (*(BYTE*)(uintptr_t(this) + 0xA28)) |= 0xE;
- *(short*)(uintptr_t(this) + 0x272) = -1;
- int result = 1;
- __asm push 0x54f12f43
- this->SetupBones(0, -1, BONE_USED_BY_ANYTHING, INTERFACES::Globals->curtime);
- __asm pop result
- this->GetVelocity() = this->EstimateAbsVelocity(); // restore velocity
- *(uint8_t*)(((uintptr_t)this) + 0x274) = v6;
- *(int*)(((uintptr_t)this) + 0xF0) = v5;
- r_jiggle_bones->SetValue(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement