SelectOrphanAreas
0x0098f360 · 480 bytes · __regparm3
_ZL17SelectOrphanAreasP16NavAreaCollector
Decompiled
undefined (1 param)
/* SelectOrphanAreas(NavAreaCollector*) */
void __regparm3 SelectOrphanAreas(NavAreaCollector *param_1)
{
int iVar1;
int iVar2;
char cVar3;
int iVar4;
Checkpoint *this;
CNavArea *pCVar5;
int iVar6;
CNavArea *local_3c [11];
iVar1 = *(int *)(param_1 + 0x10);
/* try { // try from 0098f383 to 0098f4d1 has its CatchHandler @ 0098f559 */
iVar4 = TerrorNavMesh::GetCheckpointCount(TheNavMesh);
if (iVar4 != 0) {
CNavMesh::ClearSelectedSet((CNavMesh *)TheNavMesh);
this = (Checkpoint *)TerrorNavMesh::GetCheckpoint(TheNavMesh,0);
if (this != (Checkpoint *)0x0) {
pCVar5 = (CNavArea *)Checkpoint::GetLargestArea(this);
FloodSelectCollector::FloodSelectCollector
((FloodSelectCollector *)local_3c,(TerrorNavArea *)pCVar5,0,0,0xffff,0.0,1.0,-1.0);
SearchSurroundingAreas<FloodSelectCollector>
(pCVar5,(Vector *)(pCVar5 + 0x2c),(FloodSelectCollector *)local_3c,-1.0,3,-1);
}
if (0 < DAT_00fe6000) {
iVar4 = 0;
do {
while( true ) {
pCVar5 = *(CNavArea **)(TheNavAreas + iVar4 * 4);
cVar3 = CNavMesh::IsInSelectedSet((CNavMesh *)TheNavMesh,pCVar5);
if (cVar3 == '\0') break;
LAB_0098f448:
iVar4 = iVar4 + 1;
if (DAT_00fe6000 <= iVar4) goto LAB_0098f4e8;
}
if (s_testNavID < 1) {
cVar3 = IsAreaTestable(pCVar5);
}
else {
cVar3 = s_testNavID == *(int *)(pCVar5 + 0x8c);
}
if (cVar3 == '\0') goto LAB_0098f448;
iVar2 = *(int *)(param_1 + 0x10);
local_3c[0] = pCVar5;
if ((*param_1 != (NavAreaCollector)0x0) && (0 < iVar2)) {
if (pCVar5 != (CNavArea *)**(int **)(param_1 + 4)) {
iVar6 = 0;
do {
iVar6 = iVar6 + 1;
if (iVar6 == iVar2) goto LAB_0098f4bc;
} while (pCVar5 != (CNavArea *)(*(int **)(param_1 + 4))[iVar6]);
if (iVar6 < 0) goto LAB_0098f4bc;
}
goto LAB_0098f448;
}
LAB_0098f4bc:
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(param_1 + 4),iVar2,local_3c);
iVar4 = iVar4 + 1;
} while (iVar4 < DAT_00fe6000);
}
}
LAB_0098f4e8:
if (iVar1 < *(int *)(param_1 + 0x10)) {
Warning("%s found %d areas\n","Orphan check",*(int *)(param_1 + 0x10) - iVar1);
return;
}
Msg("%s passed\n","Orphan check");
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.