HHIDE_DUMP
Гость
H
HHIDE_DUMP
Гость
Код:
// CBaseEntity:
int& GetEFlags()
{
static unsigned int offset = FindInDataMap(GetPredDescMap(), "m_iEFlags");
return *(int*)((uintptr_t)this + offset);
}
int& GetEffects() {
static unsigned int offset = FindInDataMap(GetPredDescMap(), "m_fEffects");
return *(int*)((uintptr_t)this + offset);
}
#define offset(func, type, offset) type& func { return *reinterpret_cast<type*>(reinterpret_cast<uintptr_t>(this) + offset); }
offset(get_most_recent_model_bone_counter(), uint32_t, 0x2690)
offset(get_last_bone_setup_time(), float, 0x2924)
// FRAME_NET_UPDATE_END
void AnimFixOnEntity(CBaseEntity* Entity, ResolverInfo* info)
{
auto Animstate = Entity->GetAnimState();
if (!Animstate)
return;
auto Pitch = info->m_flPitch; // resolved angle
auto AbsRotation = info->m_flGoalFeetYaw; // resolved angle
static auto OldCurtime = g_pGlobalVars->curtime;
static auto OldFrameTime = g_pGlobalVars->frametime;
static auto OldFlags = Entity->GetFlags();
static auto OldEFlags = Entity->GetEFlags();
static CAnimationLayer Layers[13];
g_pGlobalVars->curtime = Entity->GetSimulationTime();
g_pGlobalVars->frametime = g_pGlobalVars->interval_per_tick;
if (Entity->GetAnimOverlays()->m_flWeight != 0.f)
Entity->GetFlags() |= FL_ONGROUND;
Entity->GetEFlags() &= ~0x1000; // EFL_DIRTY_ABSVELOCITY
Entity->GetAbsVelocity() = Entity->GetVelocity();
memcpy(Layers, Entity->GetAnimOverlays(), sizeof(CAnimationLayer) * 13);
if (Animstate->m_iLastClientSideAnimationUpdateFramecount == g_pGlobalVars->framecount)
Animstate->m_iLastClientSideAnimationUpdateFramecount -= 1;
g_pClientState->pad_meme4[8] = true; // is hltv = true, but hook is better btw (for pvs fix)
Entity->GetClientSideAnimations() = true;
if (Pitch != FLT_MAX)
Entity->GetEyeAngles()->x = Pitch; // set resolved pitch
if (AbsRotation != FLT_MAX)
Animstate->m_flGoalFeetYaw = GoalFeetYaw; // set resolved feet yaw
Globals::ShouldUpdate = true; // u need to hook UpdateClientSideAnimation and check if this bool equals true - > call original
Entity->UpdateClientSideAnimation();
Globals::ShouldUpdate = false;
Entity->GetClientSideAnimations() = false;
g_pClientState->pad_meme4[8] = false;
memcpy(Entity->GetAnimOverlays(), Layers, sizeof(CAnimationLayer) * 13);
g_pGlobalVars->curtime = OldCurtime;
g_pGlobalVars->frametime = OldFrameTime;
Entity->GetFlags() = OldFlags;
Entity->GetEFlags() = OldEFlags;
// "rebuilding bone matrix", but it's 10% of code ahah
Entity->get_most_recent_model_bone_counter() = 0;
Entity->get_last_bone_setup_time() = -FLT_MAX;
Entity->GetEffects() |= 8;
Entity->SetupBones(nullptr, -1, 0x7FF00, Entity->GetSimulationTime());
Entity->GetEffects() &= ~8;
}