FindNeighborCornerVert
0x000d0520 · 220 bytes · __regparm3
_ZL22FindNeighborCornerVertP13CCoreDispInfoRK6Vector
Decompiled
undefined (2 params)
/* FindNeighborCornerVert(CCoreDispInfo*, Vector const&) */
int __regparm3 FindNeighborCornerVert(CCoreDispInfo *param_1,Vector *param_2)
{
short sVar1;
short sVar2;
CPowerInfo *this;
short *psVar3;
int iVar4;
int iVar5;
float fVar6;
float fVar7;
float fVar8;
int local_2c;
float local_20;
iVar5 = 0;
local_2c = 0;
local_20 = 1e+24;
do {
this = (CPowerInfo *)(*(code *)**(undefined4 **)param_1)(param_1);
psVar3 = (short *)CPowerInfo::GetCornerPointIndex(this,iVar5);
sVar1 = *psVar3;
sVar2 = psVar3[1];
iVar4 = (*(code *)**(undefined4 **)param_1)(param_1);
iVar4 = ((int)sVar1 + *(int *)(iVar4 + 0x24) * (int)sVar2) * 0x90 + *(int *)(param_1 + 0x1b8);
fVar6 = *(float *)(iVar4 + 0x2c) - *(float *)(param_2 + 4);
fVar8 = *(float *)(iVar4 + 0x30) - *(float *)(param_2 + 8);
fVar7 = *(float *)(iVar4 + 0x28) - *(float *)param_2;
fVar6 = SQRT(fVar6 * fVar6 + fVar8 * fVar8 + fVar7 * fVar7);
if (fVar6 < local_20) {
local_2c = iVar5;
local_20 = fVar6;
}
iVar5 = iVar5 + 1;
} while (iVar5 != 4);
iVar5 = -1;
if (local_20 <= 0.1) {
iVar5 = local_2c;
}
return iVar5;
}
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.