CCoreDispSurface::FindSurfPointStartIndex
0x000bd650 · 131 bytes · __thiscall
_ZN16CCoreDispSurface23FindSurfPointStartIndexEv
Decompiled
undefined (1 param)
/* CCoreDispSurface::FindSurfPointStartIndex() */
void __thiscall CCoreDispSurface::FindSurfPointStartIndex(CCoreDispSurface *this)
{
int iVar1;
int iVar2;
CCoreDispSurface *pCVar3;
float fVar4;
float fVar5;
if (*(int *)(this + 0x198) != -1) {
return;
}
iVar2 = 0;
fVar5 = 1e+09;
iVar1 = -1;
pCVar3 = this;
do {
fVar4 = (*(float *)(this + 0x19c) - *(float *)(pCVar3 + 8)) *
(*(float *)(this + 0x19c) - *(float *)(pCVar3 + 8)) +
(*(float *)(this + 0x1a4) - *(float *)(pCVar3 + 0x10)) *
(*(float *)(this + 0x1a4) - *(float *)(pCVar3 + 0x10)) +
(*(float *)(this + 0x1a0) - *(float *)(pCVar3 + 0xc)) *
(*(float *)(this + 0x1a0) - *(float *)(pCVar3 + 0xc));
if (fVar4 < fVar5) {
iVar1 = iVar2;
fVar5 = fVar4;
}
iVar2 = iVar2 + 1;
pCVar3 = pCVar3 + 0xc;
} while (iVar2 != 4);
*(int *)(this + 0x198) = iVar1;
return;
}
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.