CBasePlayerAnimState::Update
0x004202c0 · 1108 bytes · __thiscall
_ZN20CBasePlayerAnimState6UpdateEff
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBasePlayerAnimState::Update(float, float) */
void __thiscall CBasePlayerAnimState::Update(CBasePlayerAnimState *this,float param_1,float param_2)
{
char cVar1;
int iVar2;
int iVar3;
int *piVar4;
longdouble lVar5;
CBasePlayerAnimState *pCVar6;
CBaseEntity *pCVar7;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,
"/data/src/game/server/../../game/shared/base_playeranimstate.cpp",0xfd,
&Update(float,float)::tm_fmt,"(%s)%s","Unaccounted","CBasePlayerAnimState::Update");
local_20 = ___atan2f_finite;
}
iVar2 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 004204de to 0042052c has its CatchHandler @ 0042074c */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar3 = ThreadGetCurrentId(), iVar2 == iVar3)) {
if ((char *)*_DAT_0105d15c != "CBasePlayerAnimState::Update") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc0af1f,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00420378 to 00420452 has its CatchHandler @ 00420761 */
(**(code **)(*(int *)this + 0x20))(this);
pCVar6 = this;
cVar1 = (**(code **)(*(int *)this + 0x24))(this);
if (cVar1 == '\0') {
/* try { // try from 0042058d to 0042058f has its CatchHandler @ 00420761 */
(**(code **)(*(int *)this + 0xc))(this);
pCVar6 = this;
}
else {
if (0.0 < *(float *)(this + 0x2c)) {
pCVar7 = (CBaseEntity *)(this + 0x24);
pCVar6 = (CBasePlayerAnimState *)pCVar7;
lVar5 = (longdouble)CountdownTimer::Now();
if (*(float *)(this + 0x2c) <= (float)lVar5) {
/* try { // try from 00420645 to 0042073c has its CatchHandler @ 00420761 */
pCVar6 = this;
(**(code **)(*(int *)this + 0x5c))(this);
if (*(float *)(this + 0x2c) != -1.0) {
pCVar6 = (CBasePlayerAnimState *)pCVar7;
(**(code **)(*(int *)(this + 0x24) + 4))(pCVar7,this + 0x2c);
*(undefined4 *)(this + 0x2c) = 0xbf800000;
}
if ((*(int *)(this + 0x38) < 0) || (*(int *)(this + 0x3c) < 0)) {
pCVar6 = (CBasePlayerAnimState *)pCVar7;
lVar5 = (longdouble)CountdownTimer::Now();
if ((float)lVar5 + 1.0 != *(float *)(this + 0x2c)) {
pCVar6 = (CBasePlayerAnimState *)pCVar7;
(**(code **)(*(int *)(this + 0x24) + 4))(pCVar7,this + 0x2c);
*(float *)(this + 0x2c) = (float)lVar5 + 1.0;
}
if (*(float *)(this + 0x28) != 1.0) {
(**(code **)(*(int *)(this + 0x24) + 4))(pCVar7,this + 0x28);
*(undefined4 *)(this + 0x28) = 0x3f800000;
pCVar6 = (CBasePlayerAnimState *)pCVar7;
}
}
}
}
pCVar7 = *(CBaseEntity **)(this + 0x14);
piVar4 = *(int **)(pCVar7 + 0x13e0);
if (piVar4 == (int *)0x0) {
pCVar6 = (CBasePlayerAnimState *)pCVar7;
iVar2 = CBaseEntity::GetModel(pCVar7);
if (iVar2 != 0) {
pCVar6 = (CBasePlayerAnimState *)pCVar7;
CBaseAnimating::LockStudioHdr((CBaseAnimating *)pCVar7);
}
piVar4 = *(int **)(pCVar7 + 0x13e0);
if (piVar4 == (int *)0x0) goto LAB_00420590;
}
if (*piVar4 != 0) {
lVar5 = (longdouble)AngleNormalize(param_1);
*(float *)(this + 0x1c) = (float)lVar5;
lVar5 = (longdouble)AngleNormalize(param_2);
*(float *)(this + 0x20) = (float)lVar5;
(**(code **)(*(int *)this + 0x6c))(this,this + 4);
(**(code **)(*(int *)this + 0x28))(this,piVar4);
(**(code **)(*(int *)this + 0x74))(this,piVar4);
(**(code **)(*(int *)this + 0x78))(this);
(**(code **)(*(int *)this + 0x70))(this,piVar4);
(**(code **)(*(int *)this + 0x7c))(this,piVar4);
ComputePlaybackRate(this);
if (*(int *)(*(int *)(this + 0x14) + 0x30) == 0) {
iVar2 = 0;
}
else {
iVar2 = *(int *)(*(int *)(this + 0x14) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
if (*(int *)(sv_showanimstate._28_4_ + 0x30) == iVar2) {
(**(code **)(*(int *)this + 0x48))(this,0x2d);
}
iVar2 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar2 == iVar3)) {
cVar1 = CVProfNode::ExitScope();
if (cVar1 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 == 0) {
return;
}
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
return;
}
}
LAB_00420590:
iVar2 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar3 = ThreadGetCurrentId(pCVar6), iVar2 == iVar3)) {
cVar1 = CVProfNode::ExitScope();
if (cVar1 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 == 0) {
return;
}
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,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.