CCoreDispSurface::GenerateSurfPointStartIndex
0x000bd570 · 223 bytes · __thiscall
_ZN16CCoreDispSurface27GenerateSurfPointStartIndexEv
Decompiled
undefined (1 param)
/* CCoreDispSurface::GenerateSurfPointStartIndex() */
void __thiscall CCoreDispSurface::GenerateSurfPointStartIndex(CCoreDispSurface *this)
{
CCoreDispSurface *pCVar1;
int iVar2;
int iVar3;
float fVar4;
float fVar5;
float local_14;
float local_10;
float local_c;
iVar3 = 4;
local_c = 99999.0;
pCVar1 = this + 8;
fVar5 = *(float *)pCVar1;
local_10 = 99999.0;
local_14 = 99999.0;
if (99999.0 <= fVar5) goto LAB_000bd5a7;
do {
local_14 = fVar5;
LAB_000bd5a7:
do {
if (*(float *)(pCVar1 + 4) < local_10) {
local_10 = *(float *)(pCVar1 + 4);
}
if (*(float *)(pCVar1 + 8) < local_c) {
local_c = *(float *)(pCVar1 + 8);
}
pCVar1 = pCVar1 + 0xc;
iVar3 = iVar3 + -1;
if (iVar3 == 0) {
iVar3 = -1;
iVar2 = 0;
fVar5 = 1e+09;
pCVar1 = this;
do {
fVar4 = (*(float *)(pCVar1 + 8) - local_14) * (*(float *)(pCVar1 + 8) - local_14) +
(*(float *)(pCVar1 + 0x10) - local_c) * (*(float *)(pCVar1 + 0x10) - local_c) +
(*(float *)(pCVar1 + 0xc) - local_10) * (*(float *)(pCVar1 + 0xc) - local_10);
if (fVar4 < fVar5) {
iVar3 = iVar2;
fVar5 = fVar4;
}
iVar2 = iVar2 + 1;
pCVar1 = pCVar1 + 0xc;
} while (iVar2 != 4);
*(int *)(this + 0x198) = iVar3;
return;
}
fVar5 = *(float *)pCVar1;
} while (local_14 <= fVar5);
} 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.