SelectOrphanBattlefieldAreas
0x0098f570 · 662 bytes · __regparm3
_ZL28SelectOrphanBattlefieldAreasP16NavAreaCollector
Decompiled
undefined (1 param)
/* SelectOrphanBattlefieldAreas(NavAreaCollector*) */
void __regparm3 SelectOrphanBattlefieldAreas(NavAreaCollector *param_1)
{
int iVar1;
char cVar2;
Checkpoint *this;
CNavArea *pCVar3;
int iVar4;
int iVar5;
int iVar6;
CNavArea *local_3c [11];
iVar1 = *(int *)(param_1 + 0x10);
/* try { // try from 0098f594 to 0098f79e has its CatchHandler @ 0098f831 */
CNavMesh::ClearSelectedSet(TheNavMesh);
for (iVar6 = 0; iVar4 = TerrorNavMesh::GetCheckpointCount((TerrorNavMesh *)TheNavMesh),
iVar6 < iVar4; iVar6 = iVar6 + 1) {
this = (Checkpoint *)TerrorNavMesh::GetCheckpoint((TerrorNavMesh *)TheNavMesh,iVar6);
if (this != (Checkpoint *)0x0) {
pCVar3 = (CNavArea *)Checkpoint::GetLargestArea(this);
FloodSelectCollector::FloodSelectCollector
((FloodSelectCollector *)local_3c,(TerrorNavArea *)pCVar3,0,0x100,0xffff,0.0,1.0,
-1.0);
SearchSurroundingAreas<FloodSelectCollector>
(pCVar3,(Vector *)(pCVar3 + 0x2c),(FloodSelectCollector *)local_3c,-1.0,3,-1);
}
}
iVar6 = 0;
if (0 < DAT_00fe6000) {
do {
pCVar3 = *(CNavArea **)(TheNavAreas + iVar6 * 4);
if ((((byte)pCVar3[0x12d] & 1) != 0) && (-1.0 < *(float *)(pCVar3 + 0x154))) {
FloodSelectCollector::FloodSelectCollector
((FloodSelectCollector *)local_3c,(TerrorNavArea *)pCVar3,0x100,0,0xffff,0.0,1.0,
-1.0);
SearchSurroundingAreas<FloodSelectCollector>
(pCVar3,(Vector *)(pCVar3 + 0x2c),(FloodSelectCollector *)local_3c,-1.0,3,-1);
if (DAT_00fe6000 < 1) goto LAB_0098f7b0;
break;
}
iVar6 = iVar6 + 1;
} while (iVar6 != DAT_00fe6000);
iVar6 = 0;
do {
pCVar3 = *(CNavArea **)(TheNavAreas + iVar6 * 4);
cVar2 = CNavMesh::IsInSelectedSet(TheNavMesh,pCVar3);
if (cVar2 == '\0') {
if (s_testNavID < 1) {
cVar2 = IsAreaTestable(pCVar3);
}
else {
cVar2 = s_testNavID == *(int *)(pCVar3 + 0x8c);
}
if (cVar2 == '\0') goto LAB_0098f710;
local_3c[0] = pCVar3;
if (*param_1 == (NavAreaCollector)0x0) {
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
if (0 < iVar4) {
if (pCVar3 != (CNavArea *)**(int **)(param_1 + 4)) {
iVar5 = 0;
do {
iVar5 = iVar5 + 1;
if (iVar5 == iVar4) goto LAB_0098f78c;
} while (pCVar3 != (CNavArea *)(*(int **)(param_1 + 4))[iVar5]);
if (iVar5 < 0) goto LAB_0098f78c;
}
goto LAB_0098f710;
}
}
LAB_0098f78c:
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(param_1 + 4),iVar4,local_3c);
if (DAT_00fe6000 <= iVar6 + 1) break;
}
else {
LAB_0098f710:
if (DAT_00fe6000 <= iVar6 + 1) break;
}
iVar6 = iVar6 + 1;
} while( true );
}
LAB_0098f7b0:
if (iVar1 < *(int *)(param_1 + 0x10)) {
Warning("%s found %d areas\n","Missing Battlefield check",*(int *)(param_1 + 0x10) - iVar1);
return;
}
Msg("%s passed\n","Missing Battlefield 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.