CTerrorPlayerAnimState::UpdateFootYaw
0x00514250 · 1354 bytes · __thiscall
_ZN22CTerrorPlayerAnimState13UpdateFootYawEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorPlayerAnimState::UpdateFootYaw() */
void __thiscall CTerrorPlayerAnimState::UpdateFootYaw(CTerrorPlayerAnimState *this)
{
uint uVar1;
int iVar2;
char cVar3;
CBaseEntity *this_00;
int iVar4;
undefined *puVar5;
longdouble lVar6;
longdouble lVar7;
float fVar8;
float fVar9;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
int local_34;
float local_30;
float local_2c;
float local_24;
float local_20;
undefined4 local_1c;
QAngle local_18 [4];
float local_14;
local_44 = 0;
local_40 = 0;
if (___atan2f_finite == 0) {
local_34 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_44,0,0,0,0,
"/data/src/game/server/../../game/shared/terror/terrorplayeranimstate.cpp",0x9f7,
&UpdateFootYaw()::tm_fmt,"(%s)%s","Unaccounted",
"CTerrorPlayerAnimState::UpdateFootYaw");
local_34 = ___atan2f_finite;
}
iVar2 = _DAT_0105db00;
local_3c = local_44;
local_38 = local_40;
/* try { // try from 005145a6 to 005145f4 has its CatchHandler @ 005147c0 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar4 = ThreadGetCurrentId(), iVar2 == iVar4)) {
if ((char *)*_DAT_0105d15c != "CTerrorPlayerAnimState::UpdateFootYaw") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc2c9f4,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00514310 to 0051450d has its CatchHandler @ 005147d5 */
CMultiPlayerAnimState::GetOuterAbsVelocity((CMultiPlayerAnimState *)this,(Vector *)&local_30);
fVar9 = local_30 * local_30;
fVar8 = local_2c * local_2c;
cVar3 = (**(code **)(**(int **)(this + 0x118) + 0x7e8))(*(int **)(this + 0x118));
if (cVar3 != '\0') {
*(undefined4 *)(this + 0xf0) = *(undefined4 *)(this + 0xec);
}
if (this[0xdc] == (CTerrorPlayerAnimState)0x0) {
this[0xdc] = (CTerrorPlayerAnimState)0x1;
*(undefined4 *)(this + 0x134) = 0;
*(undefined4 *)(this + 0xf0) = *(undefined4 *)(this + 0xe4);
*(undefined4 *)(this + 0xec) = *(undefined4 *)(this + 0xe4);
}
this_00 = (CBaseEntity *)CTerrorPlayer::GetMountedWeapon(*(CTerrorPlayer **)(this + 0x118));
if (this_00 == (CBaseEntity *)0x0) {
if ((0.5 < SQRT(fVar8 + fVar9)) &&
(fVar9 = local_30 * local_30, fVar8 = local_2c * local_2c,
lVar6 = (longdouble)(**(code **)(*(int *)this + 0x6c))(this),
(float)lVar6 * 0.9 < SQRT(fVar8 + fVar9))) {
local_1c = 0;
local_24 = local_30;
local_20 = local_2c;
VectorAngles((Vector *)&local_24,local_18);
lVar6 = (longdouble)AngleNormalize(local_14 - *(float *)(this + 0xe4));
if ((((float)lVar6 < -100.0) || (100.0 < (float)lVar6)) &&
(local_14 = local_14 + 180.0, 360.0 <= local_14)) {
local_14 = local_14 - 360.0;
}
*(float *)(this + 0xec) = local_14;
}
cVar3 = ShouldForceFeetToEyes(this);
if ((cVar3 != '\0') ||
((fVar8 = *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x134),
*(float *)(mp_facefronttime._28_4_ + 0x2c) <= fVar8 &&
fVar8 != *(float *)(mp_facefronttime._28_4_ + 0x2c) &&
(cVar3 = (**(code **)(**(int **)(this + 0x118) + 0x7e8))(*(int **)(this + 0x118)),
cVar3 == '\0')))) {
*(undefined4 *)(this + 0xec) = *(undefined4 *)(this + 0xe4);
fVar8 = 0.0;
}
else {
fVar8 = *(float *)(this + 0xec) - *(float *)(this + 0xe4);
}
}
else {
if (((byte)this_00[0x14d] & 8) != 0) {
/* try { // try from 0051461b to 0051476b has its CatchHandler @ 005147d5 */
CBaseEntity::CalcAbsolutePosition(this_00);
}
fVar8 = *(float *)(this_00 + 0x380);
*(float *)(this + 0xec) = fVar8;
fVar8 = fVar8 - *(float *)(this + 0xe4);
}
lVar6 = (longdouble)AngleNormalize(fVar8);
lVar7 = (longdouble)GetLookRange(this);
fVar8 = (float)lVar7;
if (fVar8 < ABS((float)lVar6)) {
if ((float)lVar6 <= 0.0) {
fVar8 = -fVar8;
}
*(float *)(this + 0xec) = fVar8 + *(float *)(this + 0xe4);
}
uVar1 = *(uint *)(*(int *)(this + 0x118) + 0x33a4);
if ((((uVar1 == 0xffffffff) ||
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar5 + 4) == 0)) {
if (*(float *)(this + 0xf0) != *(float *)(this + 0xec)) {
fVar8 = *(float *)(mp_feetyawrate._28_4_ + 0x2c);
lVar6 = (longdouble)GetTurnRate(this);
fVar9 = *(float *)(mp_feetmaxyawrate._28_4_ + 0x2c);
lVar7 = (longdouble)GetTurnRate(this);
ConvergeAngles(this,*(float *)(this + 0xec),*(float *)(this + 0xe4),(float)lVar6 * fVar8,
(float)lVar7 * fVar9,*(float *)(gpGlobals + 0x10),(float *)(this + 0xf0));
}
}
else {
*(undefined4 *)(this + 0xec) = *(undefined4 *)(this + 0xe4);
*(undefined4 *)(this + 0xf0) = *(undefined4 *)(this + 0xe4);
}
iVar2 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar4 = ThreadGetCurrentId(), iVar2 == iVar4)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_34 != 0) {
(**(code **)(local_34 + 0x54))(local_34,local_3c,local_38,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.