Почему
-
Автор темы
- #1
Вот такая вот фигня с ногами
C++:
if (!Globals::LocalPlayer)
return;
if (!Globals::LocalPlayer->IsAlive())
return;
auto local_player = Globals::LocalPlayer;
bool is_local_player = entity == local_player;
bool is_teammate = local_player->GetTeam() == entity->GetTeam() && !is_local_player;
struct clientanimating_t
{
CBaseAnimState* pAnimating;
unsigned int flags;
clientanimating_t(CBaseAnimState* _pAnim, unsigned int _flags) : pAnimating(_pAnim), flags(_flags) {}
};
clientanimating_t* animating = nullptr;
int animflags;
const unsigned int FCLIENTANIM_SEQUENCE_CYCLE = 0x00000001;
CAnimationLayer AnimLayer[15];
int cnt = 15;
for (int i = 0; i < cnt; i++)
{
AnimLayer[i] = entity->GetAnimOverlay(i);
}
float flPoseParameter[24];
float* pose = (float*)((uintptr_t)entity + 0x2764);
memcpy(&flPoseParameter, pose, sizeof(float) * 24);
if (is_local_player) {
for (unsigned int i = 0; i < g_ClientSideAnimationList->count; i++)
{
clientanimating_t* animating = (clientanimating_t*)g_ClientSideAnimationList->Retrieve(i, sizeof(clientanimating_t));
C_BaseEntity* Entity = (C_BaseEntity*)animating->pAnimating;
if (Entity == local_player && !Entity->IsDormant() && Entity->GetHealth() > 0) {
bool HadClientAnimSequenceCycle[65];
int ClientSideAnimationFlags[65];
unsigned int flags = animating->flags;
ClientSideAnimationFlags[entity->EntIndex()] = flags;
HadClientAnimSequenceCycle[entity->EntIndex()] = (flags & FCLIENTANIM_SEQUENCE_CYCLE);
if (HadClientAnimSequenceCycle[entity->EntIndex()])
{
animating->flags |= FCLIENTANIM_SEQUENCE_CYCLE;
Entity->UpdateClientSideAnimation();
//Store the new animations
Entity->CopyPoseParameters(flPoseParameter);
Entity->CopyAnimLayers(AnimLayer);
}
}
}
}