CEscapeRoute::GetPathPercent
0x008ce9a0 · 194 bytes · __thiscall
_ZNK12CEscapeRoute14GetPathPercentEi
Decompiled
undefined (2 params)
/* CEscapeRoute::GetPathPercent(int) const */
longdouble __thiscall CEscapeRoute::GetPathPercent(CEscapeRoute *this,int param_1)
{
CEscapeRoute *pCVar1;
CEscapeRoute *pCVar2;
CEscapeRoute *pCVar3;
CEscapeRoute *pCVar4;
int iVar5;
float fVar6;
float fVar7;
float fVar8;
float fVar9;
float fVar10;
fVar8 = 0.0;
fVar9 = *(float *)(this + 0x1c44);
if (fVar9 != 0.0) {
iVar5 = *(int *)(this + 0x1c40) + -1;
if (param_1 < iVar5) {
pCVar3 = this + iVar5 * 0xc + 0x440;
pCVar4 = this + *(int *)(this + 0x1c40) * 0xc;
fVar6 = *(float *)(pCVar3 + 4);
fVar7 = *(float *)pCVar3;
fVar10 = *(float *)(pCVar3 + 8);
do {
pCVar3 = pCVar4 + 0x42c;
iVar5 = iVar5 + -1;
pCVar1 = pCVar4 + 0x430;
fVar6 = fVar6 - *(float *)pCVar3;
pCVar2 = pCVar4 + 0x428;
fVar10 = fVar10 - *(float *)pCVar1;
fVar7 = fVar7 - *(float *)pCVar2;
fVar8 = fVar8 + SQRT(fVar6 * fVar6 + fVar10 * fVar10 + fVar7 * fVar7);
pCVar4 = pCVar4 + -0xc;
fVar6 = *(float *)pCVar3;
fVar7 = *(float *)pCVar2;
fVar10 = *(float *)pCVar1;
} while (iVar5 != param_1);
}
fVar9 = fVar8 / fVar9;
}
return (longdouble)fVar9;
}
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.