SelectOrphanCheckpointAreas
0x0098fa80 · 691 bytes · __regparm3
_ZL27SelectOrphanCheckpointAreasP16NavAreaCollector
Decompiled
undefined (1 param)
/* SelectOrphanCheckpointAreas(NavAreaCollector*) */
void __regparm3 SelectOrphanCheckpointAreas(NavAreaCollector *param_1)
{
float fVar1;
int iVar2;
CNavArea *pCVar3;
char cVar4;
Checkpoint *this;
CNavArea *pCVar5;
int iVar6;
int iVar7;
int *piVar8;
int iVar9;
CNavArea *pCVar10;
CNavArea *local_3c [11];
iVar2 = *(int *)(param_1 + 0x10);
/* try { // try from 0098faa4 to 0098fcbe has its CatchHandler @ 0098fd58 */
CNavMesh::ClearSelectedSet(TheNavMesh);
for (iVar9 = 0; iVar6 = TerrorNavMesh::GetCheckpointCount((TerrorNavMesh *)TheNavMesh),
iVar9 < iVar6; iVar9 = iVar9 + 1) {
this = (Checkpoint *)TerrorNavMesh::GetCheckpoint((TerrorNavMesh *)TheNavMesh,iVar9);
if (this != (Checkpoint *)0x0) {
pCVar5 = (CNavArea *)Checkpoint::GetLargestArea(this);
FloodSelectCollector::FloodSelectCollector
((FloodSelectCollector *)local_3c,(TerrorNavArea *)pCVar5,0x800,0,0xffff,0.0,1.0,
-1.0);
SearchSurroundingAreas<FloodSelectCollector>
(pCVar5,(Vector *)(pCVar5 + 0x2c),(FloodSelectCollector *)local_3c,-1.0,3,-1);
}
}
if (DAT_00fe6000 < 1) {
LAB_0098fcd0:
if (iVar2 < *(int *)(param_1 + 0x10)) {
Warning("%s found %d areas\n","Missing Checkpoint check",*(int *)(param_1 + 0x10) - iVar2);
return;
}
Msg("%s passed\n","Missing Checkpoint check");
return;
}
piVar8 = TheNavAreas;
pCVar5 = (CNavArea *)0x0;
do {
pCVar3 = (CNavArea *)*piVar8;
pCVar10 = pCVar5;
if ((((((byte)pCVar3[0x12d] & 8) == 0) && (fVar1 = *(float *)(pCVar3 + 0x154), 0.0 < fVar1)) &&
(pCVar10 = pCVar3, pCVar5 != (CNavArea *)0x0)) &&
(pCVar10 = pCVar5, *(float *)(pCVar5 + 0x154) <= fVar1 && fVar1 != *(float *)(pCVar5 + 0x154)
)) {
pCVar10 = pCVar3;
}
piVar8 = piVar8 + 1;
pCVar5 = pCVar10;
} while (piVar8 != TheNavAreas + DAT_00fe6000);
if (pCVar10 != (CNavArea *)0x0) {
FloodSelectCollector::FloodSelectCollector
((FloodSelectCollector *)local_3c,(TerrorNavArea *)pCVar10,0,0x800,0xffff,0.0,1.0,-1.0
);
SearchSurroundingAreas<FloodSelectCollector>
(pCVar10,(Vector *)(pCVar10 + 0x2c),(FloodSelectCollector *)local_3c,-1.0,3,-1);
if (DAT_00fe6000 < 1) goto LAB_0098fcd0;
}
iVar9 = 0;
do {
pCVar5 = (CNavArea *)TheNavAreas[iVar9];
cVar4 = CNavMesh::IsInSelectedSet(TheNavMesh,pCVar5);
if (cVar4 == '\0') {
if (s_testNavID < 1) {
cVar4 = IsAreaTestable(pCVar5);
}
else {
cVar4 = s_testNavID == *(int *)(pCVar5 + 0x8c);
}
if (cVar4 == '\0') goto LAB_0098fc38;
local_3c[0] = pCVar5;
if (*param_1 == (NavAreaCollector)0x0) {
iVar6 = *(int *)(param_1 + 0x10);
}
else {
iVar6 = *(int *)(param_1 + 0x10);
if (0 < iVar6) {
if (pCVar5 != (CNavArea *)**(int **)(param_1 + 4)) {
iVar7 = 0;
do {
iVar7 = iVar7 + 1;
if (iVar7 == iVar6) goto LAB_0098fcac;
} while (pCVar5 != (CNavArea *)(*(int **)(param_1 + 4))[iVar7]);
if (iVar7 < 0) goto LAB_0098fcac;
}
goto LAB_0098fc38;
}
}
LAB_0098fcac:
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(param_1 + 4),iVar6,local_3c);
if (DAT_00fe6000 <= iVar9 + 1) goto LAB_0098fcd0;
}
else {
LAB_0098fc38:
if (DAT_00fe6000 <= iVar9 + 1) goto LAB_0098fcd0;
}
iVar9 = iVar9 + 1;
} 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.