ListLeafsInBox
0x00166e50 · 318 bytes · __regparm3
_ZL14ListLeafsInBoxP7mnode_tRK6VectorS3_Pti
Decompiled
undefined (5 params)
/* ListLeafsInBox(mnode_t*, Vector const&, Vector const&, unsigned short*, int) */
void __regparm3
ListLeafsInBox(mnode_t *param_1,Vector *param_2,Vector *param_3,ushort *param_4,int param_5)
{
int iVar1;
float *pfVar2;
int iVar3;
uint uVar4;
float fVar5;
float fVar6;
uint local_2014;
int aiStack_2010 [2048];
iVar3 = 0;
uVar4 = 0;
local_2014 = 0;
do {
iVar1 = *(int *)param_1;
while (-1 < iVar1) {
if ((iVar1 != 1) && (iVar3 < param_5)) {
param_4[iVar3] = (ushort)((int)param_1 - *(int *)(DAT_003a172c + 0x10) >> 6);
iVar3 = iVar3 + 1;
}
if (uVar4 == local_2014) {
return;
}
param_1 = (mnode_t *)aiStack_2010[uVar4];
uVar4 = uVar4 + 1 & 0x7ff;
iVar1 = *(int *)param_1;
}
pfVar2 = *(float **)(param_1 + 0x30);
fVar5 = (pfVar2[1] * *(float *)(param_2 + 4) + *(float *)param_2 * *pfVar2 +
*(float *)(param_2 + 8) * pfVar2[2]) - pfVar2[3];
fVar6 = ABS(pfVar2[1] * *(float *)(param_3 + 4)) + ABS(*pfVar2 * *(float *)param_3) +
ABS(pfVar2[2] * *(float *)(param_3 + 8));
if (fVar5 < fVar6) {
if (-fVar6 <= fVar5) {
aiStack_2010[local_2014] = *(int *)(param_1 + 0x34);
local_2014 = local_2014 + 1 & 0x7ff;
}
param_1 = *(mnode_t **)(param_1 + 0x38);
}
else {
param_1 = *(mnode_t **)(param_1 + 0x34);
}
} while( true );
}
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.