yoo bro, i see a big paster)()
-
Автор темы
- #1
Привет, не работает анимфикс, code ->
вызываю в креат муве ->
Видео работы -
C++:
void LocalAnimFix::UpdateLocalAnimations(bool& sendpacket)
{
auto animstate = g_LocalPlayer->GetPlayerAnimState();
if (!animstate)
return;
const auto backup_frametime = g_GlobalVars->frametime;
const auto backup_curtime = g_GlobalVars->curtime;
static std::array<float, 24> sent_pose_params = g_LocalPlayer->m_flPoseParameter();
if (animstate->m_iLastClientSideAnimationUpdateFramecount == g_GlobalVars->framecount)
animstate->m_iLastClientSideAnimationUpdateFramecount -= 1.f;
g_GlobalVars->frametime = g_GlobalVars->interval_per_tick;
g_GlobalVars->curtime = g_LocalPlayer->m_flSimulationTime();
g_LocalPlayer->m_fFlags() &= ~0x1000;
g_LocalPlayer->m_vecAbsVelocity() = g_LocalPlayer->m_vecVelocity();
animstate->m_flFeetYawRate = 0.f;
std::memcpy(backup_layers, g_LocalPlayer->GetAnimOverlays(),
(sizeof(animlayer_t) * g_LocalPlayer->GetNumAnimOverlays()));
if (sendpacket == true)
{
g_LocalPlayer->m_bClientSideAnimation() = true;
g_LocalPlayer->UpdateAnimationState(animstate, fake_angle);
sent_pose_params = g_LocalPlayer->m_flPoseParameter();
animstate->m_flCurrentFeetYaw = real_angle.yaw;
std::memcpy(g_LocalPlayer->GetAnimOverlays(), backup_layers,
(sizeof(animlayer_t) * g_LocalPlayer->GetNumAnimOverlays()));
g_LocalPlayer->InvalidateBoneCache();
g_LocalPlayer->SetupBones(nullptr, -1, 0x7FF00, g_GlobalVars->curtime);
}
g_LocalPlayer->m_bClientSideAnimation() = true;
g_GlobalVars->curtime = backup_curtime;
g_GlobalVars->frametime = backup_frametime;
g_LocalPlayer->m_flPoseParameter() = sent_pose_params;
}
C++:
if (g_EngineClient->IsInGame() && g_LocalPlayer->IsAlive())
{
LocalAnimFix::Get().UpdateLocalAnimations(bSendPacket);
}
if (bSendPacket) {
LocalAnimFix::Get().fake_angle = pCmd->angViewPoint;
LocalAnimFix::Get().real_angle = LocalAnimFix::Get().stored_real_angle;
}
LocalAnimFix::Get().stored_real_angle = pCmd->angViewPoint;
Видео работы -
Пожалуйста, авторизуйтесь для просмотра ссылки.