CM_PointLeafnumMinDistSqr_r
0x001197c0 · 157 bytes · __cdecl
_Z27CM_PointLeafnumMinDistSqr_rP17CCollisionBSPDataRK6VectoriRf
Decompiled
undefined (4 params)
/* CM_PointLeafnumMinDistSqr_r(CCollisionBSPData*, Vector const&, int, float&) */
uint CM_PointLeafnumMinDistSqr_r
(CCollisionBSPData *param_1,Vector *param_2,int param_3,float *param_4)
{
undefined4 *puVar1;
float *pfVar2;
float fVar3;
float fVar4;
float fVar5;
if (-1 < param_3) {
fVar5 = *param_4;
do {
puVar1 = (undefined4 *)(*(int *)param_1 + param_3 * 0xc);
pfVar2 = (float *)*puVar1;
if (*(byte *)(pfVar2 + 4) < 3) {
fVar3 = *(float *)(param_2 + (uint)*(byte *)(pfVar2 + 4) * 4) - pfVar2[3];
}
else {
fVar3 = (*(float *)param_2 * *pfVar2 - pfVar2[3]) + *(float *)(param_2 + 4) * pfVar2[1] +
*(float *)(param_2 + 8) * pfVar2[2];
}
fVar4 = fVar3 * fVar3;
if (fVar5 <= fVar3 * fVar3) {
fVar4 = fVar5;
}
*param_4 = fVar4;
if (fVar3 < 0.0) {
param_3 = puVar1[2];
}
else {
param_3 = puVar1[1];
}
fVar5 = fVar4;
} while (-1 < param_3);
}
return ~param_3;
}
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.