CNavMesh::BuildArea
0x0072a910 · 481 bytes · __thiscall
_ZN8CNavMesh9BuildAreaEP8CNavNodeii
Decompiled
undefined (4 params)
/* CNavMesh::BuildArea(CNavNode*, int, int) */
int __thiscall CNavMesh::BuildArea(CNavMesh *this,CNavNode *param_1,int param_2,int param_3)
{
CNavNode *pCVar1;
undefined4 uVar2;
uint uVar3;
bool bVar4;
int iVar5;
CNavNode *pCVar6;
CNavNode *pCVar7;
int iVar8;
int local_30;
CNavArea *local_20 [4];
pCVar6 = param_1;
if (param_3 < 1) {
bVar4 = true;
local_30 = 0;
pCVar7 = (CNavNode *)0x0;
}
else {
iVar8 = 0;
local_30 = 0;
pCVar7 = (CNavNode *)0x0;
do {
pCVar1 = pCVar6;
if (0 < param_2) {
iVar5 = 0;
do {
iVar5 = iVar5 + 1;
pCVar1[0x70] = (CNavNode)0x1;
pCVar1 = *(CNavNode **)(pCVar1 + 0x1c);
} while (iVar5 != param_2);
local_30 = local_30 + param_2;
}
pCVar6 = *(CNavNode **)(pCVar6 + 0x20);
if (iVar8 == 0) {
pCVar7 = pCVar1;
}
iVar8 = iVar8 + 1;
} while (iVar8 != param_3);
bVar4 = pCVar7 == (CNavNode *)0x0 || param_1 == (CNavNode *)0x0;
}
pCVar1 = pCVar6;
if (0 < param_2) {
iVar8 = 0;
do {
iVar8 = iVar8 + 1;
pCVar1 = *(CNavNode **)(pCVar1 + 0x1c);
} while (iVar8 != param_2);
}
if (((!bVar4) && (pCVar1 != (CNavNode *)0x0)) && (pCVar6 != (CNavNode *)0x0)) {
local_20[0] = (CNavArea *)(**(code **)(*(int *)this + 0x14))(this);
if (local_20[0] == (CNavArea *)0x0) {
Error("BuildArea: Out of memory.\n");
local_30 = -1;
}
else {
CNavArea::Build(local_20[0],param_1,pCVar7,pCVar1,pCVar6);
uVar2 = CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&TheNavAreas,
DAT_00fe6000,local_20);
*(undefined4 *)(local_20[0] + 0x90) = uVar2;
uVar3 = *(uint *)(param_1 + 0x5c);
*(uint *)(local_20[0] + 0x54) = uVar3;
if (((((18.0 < *(float *)(param_1 + 0x30)) || (18.0 < *(float *)(param_1 + 0x2c))) ||
((18.0 < *(float *)(pCVar7 + 0x34) ||
((18.0 < *(float *)(pCVar7 + 0x30) || (18.0 < *(float *)(pCVar1 + 0x28))))))) ||
(18.0 < *(float *)(pCVar1 + 0x34))) ||
((18.0 < *(float *)(pCVar6 + 0x2c) || (18.0 < *(float *)(pCVar6 + 0x28))))) {
uVar3 = uVar3 | 0x2000;
*(uint *)(local_20[0] + 0x54) = uVar3;
}
if (((uVar3 & 1) != 0) && (param_1[0x7e] == (CNavNode)0x0)) {
*(uint *)(local_20[0] + 0x54) = uVar3 & 0xfffffffe;
}
}
return local_30;
}
Error("BuildArea - NULL node.\n");
return -1;
}
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.