CTerrorPlayerAnimState::ComputePoseParam_MoveYaw
0x005147f0 · 1664 bytes · __thiscall
_ZN22CTerrorPlayerAnimState24ComputePoseParam_MoveYawEP10CStudioHdr
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorPlayerAnimState::ComputePoseParam_MoveYaw(CStudioHdr*) */
void __thiscall
CTerrorPlayerAnimState::ComputePoseParam_MoveYaw(CTerrorPlayerAnimState *this,CStudioHdr *param_1)
{
CBaseAnimating *pCVar1;
uint uVar2;
char cVar3;
int iVar4;
CStudioHdr *pCVar5;
int iVar6;
undefined *puVar7;
CStudioHdr *pCVar8;
longdouble lVar9;
longdouble lVar10;
float fVar11;
float fVar12;
float fVar13;
double local_74;
double local_6c;
float local_64;
float local_60 [3];
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
int local_44;
float local_40;
float local_3c;
undefined4 local_38;
float local_34;
float local_30;
float local_2c;
QAngle local_28 [4];
float local_24;
local_54 = 0;
local_50 = 0;
if (___atan2f_finite == 0) {
local_44 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_54,0,0,0,0,
"/data/src/game/server/../../game/shared/terror/terrorplayeranimstate.cpp",0xb4f,
&ComputePoseParam_MoveYaw(CStudioHdr*)::tm_fmt,"(%s)%s","Unaccounted",
"CTerrorPlayerAnimState::ComputePoseParam_MoveYaw");
local_44 = ___atan2f_finite;
}
iVar6 = _DAT_0105db00;
local_4c = local_54;
local_48 = local_50;
/* try { // try from 00514b46 to 00514b94 has its CatchHandler @ 00514eca */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar4 = ThreadGetCurrentId(), iVar6 == iVar4)) {
if ((char *)*_DAT_0105d15c != "CTerrorPlayerAnimState::ComputePoseParam_MoveYaw") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc2ca1c,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
iVar6 = _DAT_0105db00;
if (*(int *)(this + 0x118) == 0) goto joined_r0x00514d7b;
/* try { // try from 005148c1 to 00514a9b has its CatchHandler @ 00514ea9 */
CMultiPlayerAnimState::GetOuterAbsVelocity((CMultiPlayerAnimState *)this,(Vector *)&local_40);
local_38 = 0;
fVar13 = SQRT(local_3c * local_3c + local_40 * local_40);
UpdateFootYaw(this);
*(undefined4 *)(this + 0x28) = 0;
*(undefined4 *)(this + 0x20) = 0;
*(undefined4 *)(this + 0x24) = *(undefined4 *)(this + 0xf0);
if (this[0x165] == (CTerrorPlayerAnimState)0x0) {
/* try { // try from 00514bb2 to 00514c3c has its CatchHandler @ 00514ea9 */
VectorAngles((Vector *)&local_40,local_28);
lVar9 = (longdouble)AngleNormalize(*(float *)(this + 0xf0) - local_24);
if ((fVar13 <= 0.5) ||
(lVar10 = (longdouble)(**(code **)(*(int *)this + 0x6c))(this), (float)lVar10 <= 0.0)) {
fVar11 = 0.0;
fVar13 = 0.0;
}
else {
lVar10 = (longdouble)(**(code **)(*(int *)this + 0x6c))(this);
fVar13 = fVar13 / (float)lVar10;
if (fVar13 <= 0.01) {
fVar13 = 0.01;
}
sincos((double)((float)lVar9 * 0.017453292),&local_6c,&local_74);
if (1.0 <= fVar13) {
fVar13 = 1.0;
}
fVar11 = (float)(local_74 * (double)fVar13);
fVar13 = (float)((double)fVar13 * local_6c);
}
CBaseAnimating::SetPoseParameter
(*(CBaseAnimating **)(this + 0x118),param_1,*(int *)(this + 0x30),fVar11);
CBaseAnimating::SetPoseParameter
(*(CBaseAnimating **)(this + 0x118),param_1,*(int *)(this + 0x34),fVar13);
iVar6 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar4 = ThreadGetCurrentId(), iVar6 == iVar4)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_44 == 0) {
return;
}
(**(code **)(local_44 + 0x54))(local_44,local_4c,local_48,0,0,0);
return;
}
iVar6 = *(int *)(this + 0x118);
local_34 = *(float *)(iVar6 + 0x3f08);
local_30 = *(float *)(iVar6 + 0x3f0c);
local_2c = *(float *)(iVar6 + 0x3f10);
VectorAngles((Vector *)&local_34,local_28);
lVar9 = (longdouble)AngleNormalize(*(float *)(this + 0xf0) - local_24);
pCVar1 = *(CBaseAnimating **)(this + 0x118);
fVar13 = local_30;
fVar11 = local_34;
if (pCVar1[0x3f14] != (CBaseAnimating)0x0) {
sincosf((float)lVar9 * 0.017453292,local_60,&local_64);
fVar11 = SQRT(local_30 * local_30 + local_2c * local_2c + local_34 * local_34);
fVar13 = local_60[0] * fVar11;
fVar11 = local_64 * fVar11;
}
fVar12 = *(float *)(gpGlobals + 0x10) * 10.0;
if (1.0 <= fVar12) {
fVar12 = 1.0;
}
fVar11 = (fVar11 - *(float *)(this + 300)) * fVar12 + *(float *)(this + 300);
*(float *)(this + 300) = fVar11;
*(float *)(this + 0x130) = (fVar13 - *(float *)(this + 0x130)) * fVar12 + *(float *)(this + 0x130)
;
CBaseAnimating::SetPoseParameter(pCVar1,param_1,*(int *)(this + 0x30),fVar11);
CBaseAnimating::SetPoseParameter
(*(CBaseAnimating **)(this + 0x118),param_1,*(int *)(this + 0x34),
*(float *)(this + 0x130));
uVar2 = *(uint *)(*(int *)(this + 0x118) + 0x3edc);
iVar6 = _DAT_0105db00;
if ((((uVar2 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) ||
(pCVar1 = *(CBaseAnimating **)(puVar7 + 4), pCVar1 == (CBaseAnimating *)0x0))
goto joined_r0x00514d7b;
pCVar5 = *(CStudioHdr **)(pCVar1 + 0x13e0);
if (pCVar5 == (CStudioHdr *)0x0) {
/* try { // try from 00514e83 to 00514e93 has its CatchHandler @ 00514ea9 */
iVar6 = CBaseEntity::GetModel((CBaseEntity *)pCVar1);
if (iVar6 != 0) {
CBaseAnimating::LockStudioHdr(pCVar1);
}
pCVar5 = *(CStudioHdr **)(pCVar1 + 0x13e0);
pCVar8 = (CStudioHdr *)0x0;
if (pCVar5 != (CStudioHdr *)0x0) goto LAB_00514d19;
}
else {
LAB_00514d19:
pCVar8 = (CStudioHdr *)0x0;
if (*(int *)pCVar5 != 0) {
pCVar8 = pCVar5;
}
}
/* try { // try from 00514d44 to 00514db3 has its CatchHandler @ 00514ea9 */
CBaseAnimating::SetPoseParameter
(pCVar1,pCVar8,*(int *)(*(int *)(pCVar1 + 0x2910) + 0x60),*(float *)(this + 300));
CBaseAnimating::SetPoseParameter
(pCVar1,pCVar8,*(int *)(*(int *)(pCVar1 + 0x2910) + 100),*(float *)(this + 0x130));
iVar6 = _DAT_0105db00;
joined_r0x00514d7b:
_DAT_0105db00 = iVar6;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar4 = ThreadGetCurrentId(), iVar6 == iVar4)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_44 != 0) {
(**(code **)(local_44 + 0x54))(local_44,local_4c,local_48,0,0,0);
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.