CM_PointLeafnum_r
0x00119870 · 123 bytes · __cdecl
_Z17CM_PointLeafnum_rP17CCollisionBSPDataRK6Vectori
Decompiled
undefined (3 params)
/* CM_PointLeafnum_r(CCollisionBSPData*, Vector const&, int) */
uint CM_PointLeafnum_r(CCollisionBSPData *param_1,Vector *param_2,int param_3)
{
undefined4 *puVar1;
float *pfVar2;
if (-1 < param_3) {
do {
while( true ) {
puVar1 = (undefined4 *)(*(int *)param_1 + param_3 * 0xc);
pfVar2 = (float *)*puVar1;
if (2 < *(byte *)(pfVar2 + 4)) break;
if (0.0 <= *(float *)(param_2 + (uint)*(byte *)(pfVar2 + 4) * 4) - pfVar2[3])
goto LAB_0011989f;
LAB_001198e5:
param_3 = puVar1[2];
if (param_3 < 0) goto LAB_001198ec;
}
if ((*(float *)param_2 * *pfVar2 - pfVar2[3]) + *(float *)(param_2 + 4) * pfVar2[1] +
*(float *)(param_2 + 8) * pfVar2[2] < 0.0) goto LAB_001198e5;
LAB_0011989f:
param_3 = puVar1[1];
} while (-1 < param_3);
}
LAB_001198ec:
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.