CEscapeRoute::GetPositionOnPath
0x004e7da0 · 439 bytes · __thiscall
_ZNK12CEscapeRoute17GetPositionOnPathEfP6Vector
Decompiled
undefined (3 params)
/* CEscapeRoute::GetPositionOnPath(float, Vector*) const */
void __thiscall CEscapeRoute::GetPositionOnPath(CEscapeRoute *this,float param_1,Vector *param_2)
{
CEscapeRoute *pCVar1;
undefined4 uVar2;
undefined4 uVar3;
float fVar4;
float fVar5;
float fVar6;
CEscapeRoute *pCVar7;
int iVar8;
float fVar9;
float fVar10;
float fVar11;
float local_14;
float local_10;
if (param_1 <= 0.0) {
pCVar7 = this + (*(int *)(this + 0x1c40) * 3 + -3) * 4 + 0x440;
uVar2 = *(undefined4 *)(pCVar7 + 4);
uVar3 = *(undefined4 *)(pCVar7 + 8);
*(undefined4 *)param_2 = *(undefined4 *)pCVar7;
*(undefined4 *)(param_2 + 4) = uVar2;
*(undefined4 *)(param_2 + 8) = uVar3;
return;
}
if (param_1 < 1.0) {
fVar10 = param_1 * *(float *)(this + 0x1c44);
iVar8 = *(int *)(this + 0x1c40) + -1;
if (0 < iVar8) {
pCVar1 = this + iVar8 * 0xc + 0x440;
pCVar7 = this + *(int *)(this + 0x1c40) * 0xc;
fVar11 = *(float *)pCVar1;
local_14 = *(float *)(pCVar1 + 8);
local_10 = *(float *)(pCVar1 + 4);
do {
fVar4 = *(float *)(pCVar7 + 0x42c);
iVar8 = iVar8 + -1;
fVar5 = *(float *)(pCVar7 + 0x430);
fVar6 = *(float *)(pCVar7 + 0x428);
fVar9 = SQRT((local_10 - fVar4) * (local_10 - fVar4) +
(local_14 - fVar5) * (local_14 - fVar5) + (fVar11 - fVar6) * (fVar11 - fVar6));
if (fVar10 < fVar9) {
fVar10 = fVar10 / fVar9;
*(float *)param_2 = (fVar6 - fVar11) * fVar10 + fVar11;
*(float *)(param_2 + 4) = (fVar4 - local_10) * fVar10 + local_10;
*(float *)(param_2 + 8) = (fVar5 - local_14) * fVar10 + local_14;
return;
}
pCVar7 = pCVar7 + -0xc;
fVar10 = fVar10 - fVar9;
fVar11 = fVar6;
local_14 = fVar5;
local_10 = fVar4;
} while (iVar8 != 0);
}
*(undefined4 *)param_2 = vec3_origin;
*(undefined4 *)(param_2 + 4) = DAT_01053d4c;
*(undefined4 *)(param_2 + 8) = DAT_01053d50;
return;
}
uVar2 = *(undefined4 *)(this + 0x444);
uVar3 = *(undefined4 *)(this + 0x448);
*(undefined4 *)param_2 = *(undefined4 *)(this + 0x440);
*(undefined4 *)(param_2 + 4) = uVar2;
*(undefined4 *)(param_2 + 8) = uVar3;
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.