CNavMesh::InitConnectionBlockers
0x0072c2e0 · 366 bytes · __thiscall
_ZN8CNavMesh22InitConnectionBlockersEv
Decompiled
undefined (1 param)
/* CNavMesh::InitConnectionBlockers() */
void __thiscall CNavMesh::InitConnectionBlockers(CNavMesh *this)
{
int iVar1;
int iVar2;
void *pvVar3;
int iVar4;
CBaseEntity *pCVar5;
int iVar6;
int *piVar7;
*(undefined4 *)(this + 0x44) = 0;
CUtlMemory<CFuncNavConnectionBlocker*,int>::Purge
((CUtlMemory<CFuncNavConnectionBlocker*,int> *)(this + 0x38));
pCVar5 = (CBaseEntity *)0x0;
*(undefined4 *)(this + 0x48) = *(undefined4 *)(this + 0x38);
do {
pCVar5 = (CBaseEntity *)
CGlobalEntityList::FindEntityByClassname
((CGlobalEntityList *)gEntList,pCVar5,"func_nav_connection_blocker");
if (pCVar5 == (CBaseEntity *)0x0) {
Msg("%d connection blockers found!\n",*(undefined4 *)(this + 0x44));
return;
}
iVar1 = *(int *)(this + 0x44);
iVar4 = *(int *)(this + 0x3c);
iVar6 = iVar1 + 1;
if (iVar4 < iVar6) {
iVar2 = *(int *)(this + 0x40);
if (iVar2 < 0) goto LAB_0072c310;
if (iVar2 == 0) {
if (iVar4 == 0) {
if (iVar6 < 9) {
iVar2 = 8;
goto LAB_0072c38f;
}
iVar4 = 8;
}
do {
iVar2 = iVar4 * 2;
if (iVar6 <= iVar2) break;
iVar2 = iVar4 * 4;
iVar4 = iVar2;
} while (iVar2 < iVar6);
}
else {
for (iVar2 = (iVar1 / iVar2 + 1) * iVar2; iVar2 < iVar6; iVar2 = (iVar2 + iVar6) / 2) {
}
}
LAB_0072c38f:
*(int *)(this + 0x3c) = iVar2;
if (*(void **)(this + 0x38) == (void *)0x0) {
pvVar3 = malloc(iVar2 << 2);
*(void **)(this + 0x38) = pvVar3;
goto LAB_0072c313;
}
pvVar3 = realloc(*(void **)(this + 0x38),iVar2 << 2);
iVar6 = *(int *)(this + 0x44);
*(void **)(this + 0x38) = pvVar3;
*(void **)(this + 0x48) = pvVar3;
*(int *)(this + 0x44) = iVar6 + 1;
iVar6 = (iVar6 + 1) - iVar1;
}
else {
LAB_0072c310:
pvVar3 = *(void **)(this + 0x38);
LAB_0072c313:
*(int *)(this + 0x44) = iVar6;
iVar6 = iVar6 - iVar1;
*(void **)(this + 0x48) = pvVar3;
}
if (0 < iVar6 + -1) {
_V_memmove((void *)((int)pvVar3 + iVar1 * 4 + 4),(void *)((int)pvVar3 + iVar1 * 4),
(iVar6 + -1) * 4);
pvVar3 = *(void **)(this + 0x38);
}
piVar7 = (int *)(iVar1 * 4 + (int)pvVar3);
if (piVar7 != (int *)0x0) {
*piVar7 = (int)pCVar5;
}
} 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.