Path::GetPosition
0x0075f070 · 380 bytes · __thiscall
_ZNK4Path11GetPositionEfPKNS_7SegmentE
Decompiled
undefined (3 params)
/* Path::GetPosition(float, Path::Segment const*) const */
Path * __thiscall Path::GetPosition(Path *this,float param_1,Segment *param_2)
{
char cVar1;
Path *pPVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
float fVar7;
float fVar8;
float fVar9;
float local_20;
pPVar2 = (Path *)&vec3_origin;
cVar1 = (**(code **)(*(int *)this + 0x44))(this);
if (cVar1 != '\0') {
if (param_2 == (Segment *)0x0) {
param_2 = (Segment *)(this + 4);
fVar3 = *(float *)(this + 0x30);
local_20 = 0.0;
}
else {
local_20 = *(float *)(param_2 + 0x2c);
fVar3 = local_20;
}
pPVar2 = (Path *)(param_2 + 8);
if (fVar3 <= param_1) {
pPVar2 = (Path *)(**(code **)(*(int *)this + 0x58))(this,param_2);
if (pPVar2 != (Path *)0x0) {
fVar3 = *(float *)(param_2 + 0x28);
fVar6 = *(float *)(param_2 + 8);
fVar5 = *(float *)(param_2 + 0xc);
fVar4 = *(float *)(param_2 + 0x10);
param_2 = (Segment *)pPVar2;
fVar7 = local_20 + fVar3;
if (param_1 <= local_20 + fVar3) {
fVar9 = *(float *)(pPVar2 + 8) - fVar6;
fVar8 = *(float *)(pPVar2 + 0xc) - fVar5;
fVar7 = *(float *)(pPVar2 + 0x10) - fVar4;
}
else {
do {
local_20 = fVar7;
pPVar2 = (Path *)(**(code **)(*(int *)this + 0x58))(this,param_2);
if (pPVar2 == (Path *)0x0) goto LAB_0075f159;
fVar3 = *(float *)(param_2 + 0x28);
fVar6 = *(float *)(param_2 + 8);
fVar5 = *(float *)(param_2 + 0xc);
fVar4 = *(float *)(param_2 + 0x10);
param_2 = (Segment *)pPVar2;
fVar7 = local_20 + fVar3;
} while (local_20 + fVar3 < param_1);
fVar9 = *(float *)(pPVar2 + 8) - fVar6;
fVar8 = *(float *)(pPVar2 + 0xc) - fVar5;
fVar7 = *(float *)(pPVar2 + 0x10) - fVar4;
}
fVar3 = (param_1 - local_20) / fVar3;
*(float *)(this + 0x4408) = fVar9 * fVar3 + fVar6;
*(float *)(this + 0x440c) = fVar8 * fVar3 + fVar5;
*(float *)(this + 0x4410) = fVar3 * fVar7 + fVar4;
return this + 0x4408;
}
LAB_0075f159:
return (Path *)(param_2 + 8);
}
}
return pPVar2;
}
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.