SelectCornerToCornerAreas
0x0098d8f0 · 547 bytes · __regparm3
_ZL25SelectCornerToCornerAreasP16NavAreaCollector
Decompiled
undefined (1 param)
/* SelectCornerToCornerAreas(NavAreaCollector*) */
void __regparm3 SelectCornerToCornerAreas(NavAreaCollector *param_1)
{
CNavArea *pCVar1;
CNavArea *pCVar2;
int *piVar3;
int iVar4;
int iVar5;
int iVar6;
char cVar7;
int local_60;
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *local_5c;
int local_54;
CNavArea *local_50;
float local_40;
CNavArea *local_3c;
CNavArea *local_38;
NavAreaCollector *local_34;
int local_30;
char *local_2c;
undefined1 local_28 [24];
local_30 = *(int *)(param_1 + 0x10);
local_2c = "Corner-to-corner connection check";
local_34 = param_1;
if (0 < DAT_00fe6000) {
local_60 = 0;
do {
pCVar1 = *(CNavArea **)(TheNavAreas + local_60 * 4);
if (s_testNavID < 1) {
cVar7 = IsAreaTestable(pCVar1);
}
else {
cVar7 = s_testNavID == *(int *)(pCVar1 + 0x8c);
}
if (cVar7 != '\0') {
local_50 = pCVar1 + 0x58;
local_54 = 0;
do {
if ((local_50 != (CNavArea *)0x0) && (piVar3 = *(int **)local_50, 0 < *piVar3)) {
iVar6 = 0;
do {
pCVar2 = (CNavArea *)piVar3[iVar6 * 2 + 1];
if (pCVar2 != (CNavArea *)0x0) {
/* try { // try from 0098d9b4 to 0098da76 has its CatchHandler @ 0098db31 */
CNavArea::ComputePortal(pCVar1,pCVar2,local_54,local_28,&local_40);
if (local_40 < 1.0) {
local_3c = pCVar1;
if (*param_1 == (NavAreaCollector)0x0) {
iVar5 = *(int *)(param_1 + 0x10);
LAB_0098da00:
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(param_1 + 4),
iVar5,&local_3c);
iVar5 = *(int *)(param_1 + 0x10);
if ((*param_1 != (NavAreaCollector)0x0) && (0 < iVar5)) {
piVar3 = *(int **)(param_1 + 4);
goto LAB_0098da36;
}
LAB_0098da61:
local_5c = (CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(param_1 + 4);
local_38 = pCVar2;
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
(local_5c,iVar5,&local_38);
}
else {
iVar5 = *(int *)(param_1 + 0x10);
if (iVar5 < 1) goto LAB_0098da00;
piVar3 = *(int **)(param_1 + 4);
if (pCVar1 != (CNavArea *)*piVar3) {
iVar4 = 0;
do {
iVar4 = iVar4 + 1;
if (iVar4 == iVar5) goto LAB_0098da00;
} while (pCVar1 != (CNavArea *)piVar3[iVar4]);
if (iVar4 < 0) goto LAB_0098da00;
}
LAB_0098da36:
iVar4 = 0;
local_38 = pCVar2;
if (pCVar2 != (CNavArea *)*piVar3) {
do {
iVar4 = iVar4 + 1;
if (iVar4 == iVar5) goto LAB_0098da61;
} while (pCVar2 != (CNavArea *)piVar3[iVar4]);
if (iVar4 < 0) goto LAB_0098da61;
}
}
}
piVar3 = *(int **)local_50;
}
iVar6 = iVar6 + 1;
} while (iVar6 < *piVar3);
}
local_54 = local_54 + 1;
local_50 = local_50 + 4;
} while (local_54 != 4);
}
local_60 = local_60 + 1;
} while (local_60 < DAT_00fe6000);
if (local_30 < *(int *)(local_34 + 0x10)) {
Warning("%s found %d areas\n",local_2c,*(int *)(local_34 + 0x10) - local_30);
return;
}
}
Msg("%s passed\n",local_2c);
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.