-
Автор темы
- #1
Replace in structs.cpp
Add in structs.cpp
Add in structs.hpp
C++:
void player_t::update_clientside_animation()
{
if (!this || !get_animation_state() || m_clientstate()->iDeltaTick == -1)
return;
if (get_animation_state()->m_iLastClientSideAnimationUpdateFramecount >= m_globals()->m_framecount)
get_animation_state()->m_iLastClientSideAnimationUpdateFramecount = m_globals()->m_framecount - 1;
if (this == g_ctx.local()) {
m_flThirdpersonRecoil() = m_aimPunchAngleScaled().x;
}
else {
m_iEFlags() &= ~(EFL_DIRTY_ABSVELOCITY | EFL_DIRTY_ABSTRANSFORM);
}
if (get_animation_state()->m_flLastClientSideAnimationUpdateTime == m_globals()->m_curtime)
get_animation_state()->m_flLastClientSideAnimationUpdateTime = m_globals()->m_curtime + TICKS_TO_TIME(1);
g_ctx.globals.updating_animation = true;
this->m_bClientSideAnimation() = true;
auto previous_weapon = get_animation_state() ? get_animation_state()->m_pLastBoneSetupWeapon : nullptr;
if (previous_weapon)
get_animation_state()->m_pLastBoneSetupWeapon = get_animation_state()->m_pActiveWeapon;
using Fn = void(__thiscall*)(void*);
call_virtual<Fn>(this, g_ctx.indexes.at(13))(this);
g_ctx.globals.updating_animation = false;
}
C++:
Vector player_t::m_aimPunchAngleScaled()
{
if (!this)
return ZERO;
static auto weapon_recoil_scale = m_cvar()->FindVar(crypt_str("weapon_recoil_scale"));
const auto m_aim_punch_angle = m_aimPunchAngle();
return m_aim_punch_angle * weapon_recoil_scale->GetFloat();
}
C++:
Vector m_aimPunchAngleScaled();