Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void animationfix(SDK::CBaseEntity* player)
- {
- if (player == nullptr)
- return;
- if (!player->is_self_animating())
- return;
- int v6; // ecx
- int v7; // eax
- int v8; // edi
- int v9; // ecx
- int simTime; // ebx
- char v13; // [esp+10h] [ebp-348h]
- const float curtime = INTERFACES::Globals->curtime;
- const float frametime = INTERFACES::Globals->frametime;
- simTime = player->GetSimTime();
- auto GetClientSideAnimation = player->GetClientSideAnimation();
- *GetClientSideAnimation = true;
- INTERFACES::Globals->frametime = INTERFACES::Globals->interval_per_tick;
- INTERFACES::Globals->curtime = player->GetSimTime();
- LagRecord records = timesim->CreateRecord(player);
- auto state = player->GetAnimState();
- auto old_ragpos = player->get_ragdoll_pos();
- auto &tracks = timesim->m_PlayerTracks[player->GetIndex() - 1];
- if (state)
- {
- v7 = INTERFACES::Globals->framecount;
- if (state)
- state->m_iLastClientSideAnimationUpdateFramecount = INTERFACES::Globals->framecount - 1;
- v8 = player->GetFlags();
- v9 = records.m_fFlags;
- *player->GetFlags2() = v9;
- if (tracks.size() > 2)
- {
- if ((player->GetSimTime() - tracks.at(2).first.m_flSimulationTime) > 1)
- {
- *player->GetFlags2() &= 0xFFFFFFFE;
- }
- }
- if (v9 & 1
- && !(records.m_fFlags & 1)
- && (((player->GetSimTime() - records.m_flSimulationTime) / INTERFACES::Globals->interval_per_tick) + 0.5) > 2)
- {
- *player->GetFlags2() = v9 & 0xFFFFFFFE;
- }
- }
- //AddBaseAnimatingInterpolatedVars(player);
- //ClientSideAnimationChanged(player);
- //UpdateClientSideAnimations(player);
- player->get_ragdoll_pos() = old_ragpos;
- player->UpdateClientSideAnimation();
- INTERFACES::Globals->curtime = curtime;
- INTERFACES::Globals->frametime = frametime;
- //player->SetAbsAngles(Vector(0.f, player->GetAnimState()->m_flGoalFeetYaw, 0.f));
- *GetClientSideAnimation = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement