CBasePlayerAnimState::ConvergePoseParams
0x00420df0 · 860 bytes · __thiscall
_ZN20CBasePlayerAnimState18ConvergePoseParamsEfii
Decompiled
undefined (4 params)
/* CBasePlayerAnimState::ConvergePoseParams(float, int, int) */
longdouble __thiscall
CBasePlayerAnimState::ConvergePoseParams
(CBasePlayerAnimState *this,float param_1,int param_2,int param_3)
{
CBaseEntity *this_00;
CBaseAnimating *pCVar1;
char cVar2;
int iVar3;
CStudioHdr *pCVar4;
CStudioHdr *pCVar5;
longdouble lVar6;
float fVar7;
float fVar8;
float fVar9;
float local_2c;
float local_28;
float local_24;
float local_20 [4];
if ((*(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x88)) ||
(cVar2 = (**(code **)(*(int *)this + 0x90))(this,param_2,param_3), cVar2 == '\0')) {
SnapPoseParams(this,param_2,param_3,param_1,0.0);
goto LAB_00420e3f;
}
if (param_3 < 0) {
param_1 = 0.0;
goto LAB_00420e3f;
}
if (param_2 < 0) {
pCVar1 = *(CBaseAnimating **)(this + 0x14);
pCVar4 = *(CStudioHdr **)(pCVar1 + 0x13e0);
if (pCVar4 == (CStudioHdr *)0x0) {
iVar3 = CBaseEntity::GetModel((CBaseEntity *)pCVar1);
if (iVar3 == 0) {
pCVar4 = *(CStudioHdr **)(pCVar1 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr(pCVar1);
pCVar4 = *(CStudioHdr **)(pCVar1 + 0x13e0);
}
pCVar5 = (CStudioHdr *)0x0;
if (pCVar4 != (CStudioHdr *)0x0) goto LAB_00421031;
}
else {
LAB_00421031:
pCVar5 = (CStudioHdr *)0x0;
if (*(int *)pCVar4 != 0) {
pCVar5 = pCVar4;
}
}
CBaseAnimating::SetPoseParameter(pCVar1,pCVar5,param_3,param_1);
goto LAB_00420e3f;
}
CBaseAnimating::GetPoseParameterRange
(*(CBaseAnimating **)(this + 0x14),param_2,&local_2c,&local_28);
CBaseAnimating::GetPoseParameterRange
(*(CBaseAnimating **)(this + 0x14),param_3,&local_24,local_20);
lVar6 = (longdouble)CBaseAnimating::GetPoseParameter(*(CBaseAnimating **)(this + 0x14),param_3);
iVar3 = gpGlobals;
if (ABS(*(float *)(this + 0x1c) - *(float *)(this + 0x84)) <= 1.0) {
fVar7 = *(float *)(this + 0x80);
}
else {
fVar7 = *(float *)(gpGlobals + 0xc);
*(float *)(this + 0x84) = *(float *)(this + 0x1c);
*(float *)(this + 0x80) = fVar7;
}
fVar7 = *(float *)(iVar3 + 0xc) - fVar7;
if (fVar7 <= 0.5) {
fVar7 = 0.01;
}
else {
fVar7 = fVar7 - 0.5;
if (fVar7 < 1.0) {
fVar7 = fVar7 * 0.1;
if (fVar7 <= 0.01) {
fVar7 = 0.01;
}
}
else {
fVar7 = 0.1;
}
}
fVar7 = (param_1 - (float)lVar6) * fVar7;
if (fVar7 <= -10.0) {
fVar7 = -10.0;
}
if (10.0 <= fVar7) {
fVar7 = 10.0;
}
fVar7 = fVar7 + (float)lVar6;
fVar8 = param_1 - fVar7;
if ((local_28 < fVar8) || (fVar9 = fVar8, local_28 = local_2c, fVar8 < local_2c)) {
fVar9 = local_28;
fVar7 = (fVar7 - fVar9) + fVar8;
}
this_00 = *(CBaseEntity **)(this + 0x14);
pCVar4 = *(CStudioHdr **)(this_00 + 0x13e0);
if (pCVar4 == (CStudioHdr *)0x0) {
iVar3 = CBaseEntity::GetModel(this_00);
if (iVar3 == 0) {
pCVar4 = *(CStudioHdr **)(this_00 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr((CBaseAnimating *)this_00);
pCVar4 = *(CStudioHdr **)(this_00 + 0x13e0);
}
pCVar5 = (CStudioHdr *)0x0;
if (pCVar4 != (CStudioHdr *)0x0) goto LAB_00420f97;
}
else {
LAB_00420f97:
pCVar5 = (CStudioHdr *)0x0;
if (*(int *)pCVar4 != 0) {
pCVar5 = pCVar4;
}
}
CBaseAnimating::SetPoseParameter((CBaseAnimating *)this_00,pCVar5,param_2,fVar9);
pCVar1 = *(CBaseAnimating **)(this + 0x14);
pCVar4 = *(CStudioHdr **)(pCVar1 + 0x13e0);
if (pCVar4 == (CStudioHdr *)0x0) {
iVar3 = CBaseEntity::GetModel((CBaseEntity *)pCVar1);
if (iVar3 == 0) {
pCVar4 = *(CStudioHdr **)(pCVar1 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr(pCVar1);
pCVar4 = *(CStudioHdr **)(pCVar1 + 0x13e0);
}
pCVar5 = (CStudioHdr *)0x0;
if (pCVar4 != (CStudioHdr *)0x0) goto LAB_00420fd2;
}
else {
LAB_00420fd2:
pCVar5 = (CStudioHdr *)0x0;
if (*(int *)pCVar4 != 0) {
pCVar5 = pCVar4;
}
}
CBaseAnimating::SetPoseParameter(pCVar1,pCVar5,param_3,fVar7);
LAB_00420e3f:
return (longdouble)param_1;
}
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.