-
Автор темы
- #1
original post
https://yougame.biz/threads/154791/
this is not fully reversed and some stuff may be wrong or may not be included from the original post psudo code
lets see who is gonna past this into weave or supremacy XD
https://yougame.biz/threads/154791/
this is not fully reversed and some stuff may be wrong or may not be included from the original post psudo code
lets see who is gonna past this into weave or supremacy XD
C++:
void onetap_animlayerresolver(C_CSPlayer* player, CLagrecord* m_nResolverData, CLagrecord* previous)
{
signed int v30; // esi
int v31; // eax
float* v32; // esi
int v33; // eax
float m_angRotation.y; // xmm6_4
float v35; // xmm5_4
int v36; // edx
int v37; // ecx
__m128 v38; // xmm0
float m_flAbsYaw; // xmm6_4
__m128 v40; // xmm0
float v41; // xmm5_4
__m128 v42; // xmm0
double m_nSpeed; // xmm0_8
float DeltaFirst; // xmm3_4
float DeltaSecond; // xmm2_4
float DeltaThird; // xmm1_4
float m_vec_angles.y; // xmm0_4
__m128 m_Delta; // xmm0
float v49; // [esp+Ch] [ebp-4Ch]
float v50; // [esp+10h] [ebp-48h]
int v51; // [esp+14h] [ebp-44h]
float v52; // [esp+18h] [ebp-40h]
char v53[12]; // [esp+1Ch] [ebp-3Ch]
float v54; // [esp+28h] [ebp-30h]
float v55; // [esp+34h] [ebp-24h]
float v56; // [esp+38h] [ebp-20h]
float v57; // [esp+3Ch] [ebp-1Ch]
float v58; // [esp+40h] [ebp-18h]
float v60; // [esp+48h] [ebp-10h]
char v61; // [esp+4Ch] [ebp-Ch]
float v62; // [esp+50h] [ebp-8h]
if (m_nResolverData)
m_nResolverData->ResolvingWay = 0; // set ResolvingWay to 0
float m_istate = player->get_animstate();
float m_flbruteangle = g_cmd->viewangles.y;
if (m_istate && m_nResolverData && a3 && m_istate->gap0[3060])
{
Math::AngleDifference(g_cmd->viewangles.y, m_istate->m_flGoalFeetYaw);
float v7 = Math::AngleDifference(m_flbruteangle, m_istate->m_flGoalFeetYaw);
v8 = v7 > 0.1;
if (v6)
v9 = v6 == v8;
else
v9 = v7 <= 0.1;
if (!v9)
{
m_nResolverData->byte34C = 1;
m_nResolverData->dword350 = 2 * v8 - 1;
}
if (m_istate->gap0[28] == off_3FEBE5A8[1234])
{
// Rebuild setup velocity to receive flMinBodyYaw and flMaxBodyYaw and est there desync
Vector velocity = m_nResolverData->m_vecVelocity_y;
float spd = velocity.LengthSqr();
if (spd > std::powf(1.2f * 260.0f, 2.f)) {
Vector velocity_normalized = velocity.Normalized();
velocity = velocity_normalized * (1.2f * 260.0f);
}
float v25 = std::clamp(m_nResolverData->get_duck_amt() + m_nResolverData->get_anim_state()->m_fLandingDuckAdditiveSomething, 0.0f, 1.0f);
float v26 = m_nResolverData->get_animstate()->m_fDuckAmount;
float v27 = m_nResolverData->get_animstate()->m_flLastClientSideAnimationUpdateTime * 6.0f;
float v28;
// clamp
if ((v25 - v26) <= v27) {
if (-v27 <= (v25 - v26))
v28 = v25;
else
v28 = v26 - v27;
}
else {
v28 = v26 + v27;
}
float flDuckAmount = std::clamp(v28, 0.0f, 1.0f);
Vector animationVelocity = GetSmoothedVelocity(m_nResolverData->get_animstate()->m_flLastClientSideAnimationUpdateTime * 2000.0f, velocity, player->get_velocity());
float speed = std::fminf(animationVelocity.Length(), 260.0f);
auto weapon = get_weapon(m_nResolverData->get_active_weapon());
float flMaxMovementSpeed = 260.0f;
if (weapon) {
flMaxMovementSpeed = std::fmaxf(weapon->get_wpn_data_safe()->flMaxSpeed, 0.001f);
}
float m_flGroundFraction = *(float*)(m_nResolverData->get_anim_state() + 0x11C);
float flRunningSpeed = speed / (flMaxMovementSpeed * 0.520f);
float flDuckingSpeed = speed / (flMaxMovementSpeed * 0.340f);
flRunningSpeed = std::clamp(flRunningSpeed, 0.0f, 1.0f);
float flYawModifier = (((m_flGroundFraction * -0.3f) - 0.2f) * flRunningSpeed) + 1.0f;
if (flDuckAmount > 0.0f) {
float flDuckingSpeed = std::clamp(flDuckingSpeed, 0.0f, 1.0f);
flYawModifier += (flDuckAmount * flDuckingSpeed) * (0.5f - flYawModifier);
}
m_flMinBodyYaw = flYawModifier * std::fabsf(((float)(uintptr_t(m_nResolverData->get_animstate()) + 0x330)));
m_flMaxBodyYaw = flYawModifier * std::fabsf(((float)(uintptr_t(m_nResolverData->get_animstate()) + 0x334)));
}
if (m_nResolverData->m_iFlags & 1 && v5->m_fFlags[0x24] & 1 && !m_nResolverData->GetFlags && !state->byteC0C)
{
m_nSpeed = (m_nResolverData->m_vecVelocity_y * m_nResolverData->m_vecVelocity_y) + (m_nResolverData->m_vecVelocity_z * m_nResolverData->m_vecVelocity_z);
if (m_nSpeed <= 0.1)
{
if (m_nResolverData->server_anim_layers[3] == 0.0
&& m_nResolverData->server_anim_layers[3] == 0.0
&& m_nResolverData->server_anim_layers[3] == 0.0)
{
m_vec_angles.y = m_nResolverData->m_nResolvedEyeAngles_y;
m_nResolverData->ResolvingWay = 1;
m_Delta = Math::AngleDifference(m_vec_angles.y, state->m_flGoalFeetYaw);
m_nResolverData->ResolvingMethod = 2 * (m_Delta.clamp[0] <= 0.0) - 1;
}
}
else if (!(m_nResolverData->server_anim_layers[12] * 1000.0) && (m_nResolverData->server_anim_layers[6].m_flWeight * 1000.f) == (previous.anim_layers[6].m_flWeight * 1000.f))
{
float DeltaFirst = abs(m_nResolverData->server_anim_layers[6].m_flPlaybackRate - m_nResolverData->resolver_anim_layers[0][6].m_flPlaybackRate);
float DeltaSecond = abs(m_nResolverData->server_anim_layers[6].m_flPlaybackRate - m_nResolverData->resolver_anim_layers[1][6].m_flPlaybackRate);
float DeltaThird = abs(m_nResolverData->server_anim_layers[6].m_flPlaybackRate - m_nResolverData->resolver_anim_layers[2][6].m_flPlaybackRate);
if (DeltaFirst < DeltaSecond || DeltaThird <= DeltaSecond || (DeltaSecond * 1000.0))
{
if (DeltaFirst >= DeltaThird && DeltaSecond > DeltaThird && !(DeltaThird * 1000.0))
{
m_nResolverData->ResolvingWay = 1;
m_nResolverData->ResolvingMethod = 1;
}
}
else
{
m_nResolverData->ResolvingWay = 1;
m_nResolverData->ResolvingMethod = -1;
}
}
}
}
// i just added this part here for example u should do some kind of resolver streangth to
m_flbruteangle = (m_nResolverData->ResolvingMethod > 0.f) ? +m_flEstimatedMaxDesync : -m_flEstimatedMaxDesync;
player->get_animstate()->m_flGoalFeetYaw = m_flbruteangle;
}
Последнее редактирование: