mstudioanimdesc_t::pAnim
0x0059c250 · 1237 bytes · __thiscall
_ZNK17mstudioanimdesc_t5pAnimEPiRf
Decompiled
undefined (3 params)
/* mstudioanimdesc_t::pAnim(int*, float&) const */
mstudioanimdesc_t * __thiscall
mstudioanimdesc_t::pAnim(mstudioanimdesc_t *this,int *param_1,float *param_2)
{
mstudioanimdesc_t *pmVar1;
int iVar2;
int iVar3;
mstudioanimdesc_t *pmVar4;
int iVar5;
int iVar6;
mstudioanimdesc_t *pmVar7;
longdouble lVar8;
longdouble lVar9;
float fVar10;
int local_20;
iVar2 = 0;
iVar5 = *(int *)(this + 0x54);
local_20 = *(int *)(this + 0x34);
iVar3 = *(int *)(this + 0x38);
if (iVar5 != 0) {
if (iVar5 < *(int *)(this + 0x10)) {
iVar3 = *param_1;
if (iVar3 != *(int *)(this + 0x10) + -1) goto LAB_0059c283;
*param_1 = 0;
iVar2 = *(int *)(this + 0x10) / *(int *)(this + 0x54) + 1;
}
else {
iVar3 = *param_1;
LAB_0059c283:
iVar2 = iVar3 / iVar5;
*param_1 = iVar3 - iVar5 * iVar2;
}
local_20 = *(int *)(this + *(int *)(this + 0x50) + iVar2 * 8);
iVar3 = *(int *)(this + *(int *)(this + 0x50) + iVar2 * 8 + 4);
}
if (local_20 == -1) {
return (mstudioanimdesc_t *)0x0;
}
if (local_20 == 0) {
pmVar4 = this + iVar3;
}
else {
iVar5 = studiohdr_t::GetAnimBlock((studiohdr_t *)(this + *(int *)this),local_20);
if (iVar5 == 0) {
pmVar4 = (mstudioanimdesc_t *)0x0;
}
else {
pmVar4 = (mstudioanimdesc_t *)(iVar5 + iVar3);
}
}
if (*(int *)(this + 0x54) != 0) {
iVar5 = iVar2 + 1;
iVar3 = *(int *)(this + 0x10) / *(int *)(this + 0x54) + 2;
if (iVar5 < iVar3) {
pmVar7 = this + iVar5 * 8 + *(int *)(this + 0x50);
iVar6 = *(int *)pmVar7;
if (local_20 == iVar6) {
pmVar1 = this + *(int *)(this + 0x50) + 8 + iVar5 * 8;
do {
pmVar7 = pmVar1;
iVar5 = iVar5 + 1;
if (iVar5 == iVar3) goto LAB_0059c32a;
iVar6 = *(int *)pmVar7;
pmVar1 = pmVar7 + 8;
} while (local_20 == iVar6);
}
pAnimBlock(this,iVar6,*(int *)(pmVar7 + 4));
}
}
LAB_0059c32a:
if (*(int *)(mod_load_showstall._28_4_ + 0x30) == -1) {
if (pmVar4 == (mstudioanimdesc_t *)0x0) {
if (*(float *)(this + 0x20) == 0.0) {
lVar9 = (longdouble)Plat_FloatTime();
*(float *)(this + 0x20) = (float)lVar9;
}
goto LAB_0059c5b8;
}
if (*(float *)(this + 0x20) != 0.0) {
if ((iVar2 != 0) || ((int)*(short *)(this + 0x58) * (int)*(short *)(this + 0x5a) < *param_1))
{
iVar5 = *(int *)(this + 4);
iVar3 = *(int *)this;
lVar9 = (longdouble)Plat_FloatTime();
fVar10 = *(float *)(this + 0x20);
lVar8 = (longdouble)Plat_FloatTime();
Msg("[%8.3f] stalled %0.2f on %s:%s:%d:%d\n",(double)lVar8,(double)lVar9 - (double)fVar10,
this + iVar3 + 0xc,this + iVar5,iVar2,local_20);
}
*(undefined4 *)(this + 0x20) = 0;
*param_2 = 0.0;
fVar10 = *(float *)(this + 0x60);
goto joined_r0x0059c464;
}
}
else if (pmVar4 == (mstudioanimdesc_t *)0x0) {
LAB_0059c5b8:
if ((0 < iVar2) && (0 < *(int *)(mod_load_showstall._28_4_ + 0x30))) {
iVar5 = *(int *)(this + 4);
iVar3 = *(int *)this;
lVar9 = (longdouble)Plat_FloatTime();
Msg("[%8.3f] hitch on %s:%s:%d:%d\n",(double)lVar9,this + iVar3 + 0xc,this + iVar5,iVar2,
local_20);
}
iVar2 = iVar2 + -1;
iVar5 = iVar2 * 8;
while( true ) {
if (iVar2 < 0) {
*param_2 = 0.0;
lVar9 = (longdouble)Plat_FloatTime();
*(float *)(this + 0x60) = (float)lVar9;
*param_2 = 1.0;
if (*(int *)(mod_load_showstall._28_4_ + 0x30) < 2) {
return (mstudioanimdesc_t *)0x0;
}
iVar5 = *(int *)(this + 4);
iVar3 = *(int *)this;
lVar9 = (longdouble)Plat_FloatTime();
Msg("[%8.3f] stall on %s:%s:%d:%d\n",(double)lVar9,this + iVar3 + 0xc,this + iVar5,iVar2,
local_20);
return (mstudioanimdesc_t *)0x0;
}
local_20 = *(int *)(this + *(int *)(this + 0x50) + iVar5);
iVar3 = *(int *)(this + *(int *)(this + 0x50) + iVar5 + 4);
if ((local_20 != -1) &&
(((pmVar4 = this, local_20 == 0 ||
(pmVar4 = (mstudioanimdesc_t *)
studiohdr_t::GetAnimBlock((studiohdr_t *)(this + *(int *)this),local_20),
pmVar4 != (mstudioanimdesc_t *)0x0)) &&
(pmVar4 = pmVar4 + iVar3, pmVar4 != (mstudioanimdesc_t *)0x0)))) break;
iVar5 = iVar5 + -8;
iVar2 = iVar2 + -1;
}
*param_1 = *(int *)(this + 0x54) + -1;
}
*param_2 = 0.0;
fVar10 = *(float *)(this + 0x60);
joined_r0x0059c464:
if (fVar10 != 0.0) {
lVar9 = (longdouble)Plat_FloatTime();
if ((float)lVar9 - *(float *)(this + 0x60) < 0.0) {
fVar10 = *param_2;
}
else {
fVar10 = (0.2 - ((float)lVar9 - *(float *)(this + 0x60))) * 5.0;
if (fVar10 <= 1.0) {
if (fVar10 <= 0.0) {
fVar10 = 0.0;
}
fVar10 = fVar10 * fVar10 * 3.0 - (fVar10 + fVar10) * fVar10 * fVar10;
}
else {
fVar10 = 1.0;
}
*param_2 = fVar10;
}
if (fVar10 == 0.0) {
*(undefined4 *)(this + 0x60) = 0;
}
else if (1 < *(int *)(mod_load_showstall._28_4_ + 0x30)) {
iVar5 = *(int *)(this + 4);
iVar3 = *(int *)this;
lVar9 = (longdouble)Plat_FloatTime();
Msg("[%8.3f] stall blend %.2f on %s:%s:%d:%d\n",(double)lVar9,(double)fVar10,
this + iVar3 + 0xc,this + iVar5,iVar2,local_20);
}
}
return pmVar4;
}
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.