Studio_AnimVelocity
0x00b95aa0 · 214 bytes · __cdecl
_Z19Studio_AnimVelocityP17mstudioanimdesc_tfR6Vector
Decompiled
undefined (3 params)
/* Studio_AnimVelocity(mstudioanimdesc_t*, float, Vector&) */
undefined4 Studio_AnimVelocity(mstudioanimdesc_t *param_1,float param_2,Vector *param_3)
{
mstudioanimdesc_t *pmVar1;
mstudioanimdesc_t *pmVar2;
int iVar3;
float fVar4;
float fVar5;
float fVar6;
fVar6 = param_2 * (float)(*(int *)(param_1 + 0x10) + -1);
fVar6 = fVar6 - (float)(int)(fVar6 / (float)(*(int *)(param_1 + 0x10) + -1));
if (*(int *)(param_1 + 0x14) < 1) {
return 0;
}
iVar3 = 0;
pmVar2 = param_1 + *(int *)(param_1 + 0x18);
fVar4 = (float)*(int *)pmVar2;
pmVar1 = param_1 + *(int *)(param_1 + 0x18) + 0x2c;
if (fVar6 <= fVar4) {
fVar5 = 0.0;
}
else {
do {
fVar5 = fVar4;
pmVar2 = pmVar1;
iVar3 = iVar3 + 1;
if (iVar3 == *(int *)(param_1 + 0x14)) {
return 0;
}
fVar4 = (float)*(int *)pmVar2;
pmVar1 = pmVar2 + 0x2c;
} while (fVar4 < fVar6);
}
fVar6 = (fVar6 - fVar5) / (fVar4 - fVar5);
fVar5 = (((1.0 - fVar6) * *(float *)(pmVar2 + 8) + fVar6 * *(float *)(pmVar2 + 0xc)) *
*(float *)(param_1 + 8)) / (fVar4 - fVar5);
fVar6 = *(float *)(pmVar2 + 0x1c);
fVar4 = *(float *)(pmVar2 + 0x14);
*(float *)(param_3 + 4) = *(float *)(pmVar2 + 0x18) * fVar5;
*(float *)(param_3 + 8) = fVar6 * fVar5;
*(float *)param_3 = fVar5 * fVar4;
return 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.