SetupCornerNeighbors
0x000d1b80 · 464 bytes · __cdecl
_Z20SetupCornerNeighborsP13CCoreDispInfoS0_Pi
Decompiled
undefined (3 params)
/* SetupCornerNeighbors(CCoreDispInfo*, CCoreDispInfo*, int*) */
void SetupCornerNeighbors(CCoreDispInfo *param_1,CCoreDispInfo *param_2,int *param_3)
{
byte bVar1;
short sVar2;
char cVar3;
CPowerInfo *pCVar4;
short *psVar5;
int iVar6;
int iVar7;
int iVar8;
int iVar9;
int iVar10;
int iVar11;
int local_2c;
int local_28;
iVar6 = *(int *)(param_2 + 0x204);
cVar3 = HasEdgeNeighbor(param_1,iVar6);
if (cVar3 == '\0') {
local_28 = 0;
iVar10 = -1;
iVar11 = -1;
local_2c = 0;
do {
pCVar4 = (CPowerInfo *)(*(code *)**(undefined4 **)param_1)(param_1,iVar6,iVar10,iVar11);
psVar5 = (short *)CPowerInfo::GetCornerPointIndex(pCVar4,local_28);
sVar2 = psVar5[1];
iVar6 = (*(code *)**(undefined4 **)param_1)(param_1);
iVar8 = 0;
iVar9 = ((int)sVar2 * *(int *)(iVar6 + 0x24) + (int)*psVar5) * 0x90 +
*(int *)(param_1 + 0x1b8);
do {
pCVar4 = (CPowerInfo *)(*(code *)**(undefined4 **)param_2)(param_2);
iVar6 = iVar8;
psVar5 = (short *)CPowerInfo::GetCornerPointIndex(pCVar4,iVar8);
sVar2 = psVar5[1];
iVar7 = (*(code *)**(undefined4 **)param_2)(param_2);
iVar7 = ((int)sVar2 * *(int *)(iVar7 + 0x24) + (int)*psVar5) * 0x90 +
*(int *)(param_2 + 0x1b8);
if (((ABS(*(float *)(iVar9 + 0x28) - *(float *)(iVar7 + 0x28)) <= 0.001) &&
(ABS(*(float *)(iVar9 + 0x2c) - *(float *)(iVar7 + 0x2c)) <= 0.001)) &&
(ABS(*(float *)(iVar9 + 0x30) - *(float *)(iVar7 + 0x30)) <= 0.001)) {
local_2c = local_2c + 1;
iVar10 = iVar8;
iVar11 = local_28;
}
iVar8 = iVar8 + 1;
} while (iVar8 != 4);
local_28 = local_28 + 1;
} while (local_28 != 4);
if (local_2c == 1) {
iVar6 = (**(code **)(*(int *)param_1 + 8))(param_1,iVar11);
iVar10 = (**(code **)(*(int *)param_2 + 8))(param_2,iVar10);
bVar1 = *(byte *)(iVar6 + 8);
if ((bVar1 < 4) && (*(byte *)(iVar10 + 8) < 4)) {
*(byte *)(iVar6 + 8) = bVar1 + 1;
*(short *)(iVar6 + (uint)bVar1 * 2) = (short)*(undefined4 *)(param_2 + 0x204);
bVar1 = *(byte *)(iVar10 + 8);
*(byte *)(iVar10 + 8) = bVar1 + 1;
*(short *)(iVar10 + (uint)bVar1 * 2) = (short)*(undefined4 *)(param_1 + 0x204);
}
else {
*param_3 = *param_3 + 1;
}
}
}
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.