CNavMesh::CommandAutoBuildOffGridAreas
0x007119c0 · 759 bytes · __thiscall
_ZN8CNavMesh28CommandAutoBuildOffGridAreasEv
Decompiled
undefined (1 param)
/* CNavMesh::CommandAutoBuildOffGridAreas() */
void __thiscall CNavMesh::CommandAutoBuildOffGridAreas(CNavMesh *this)
{
char cVar1;
CNavArea *pCVar2;
int iVar3;
int iVar4;
float fVar5;
Vector *pVVar6;
Vector *pVVar7;
CUtlMemory<Extent,int> *local_80;
float local_70;
float local_6c;
undefined4 local_68;
float local_64;
float local_60;
float local_58;
float local_54;
float local_4c;
float local_48;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
pVVar6 = (Vector *)&local_70;
local_68 = *(undefined4 *)(this + 0x46c);
local_70 = (float)(int)(*(float *)(this + 0x464) + *(float *)(this + 0x464)) * 0.5;
local_6c = (float)(int)(*(float *)(this + 0x468) + *(float *)(this + 0x468)) * 0.5;
pVVar7 = pVVar6;
pCVar2 = (CNavArea *)GetNavArea(this,pVVar6,4.0);
if (pCVar2 != (CNavArea *)0x0) {
CNavArea::GetExtent(pCVar2,(Extent *)&local_34);
local_40 = local_28 - local_34;
local_3c = local_24 - local_30;
local_38 = local_20 - local_2c;
NDebugOverlay::Box((Vector *)&local_34,(Vector *)&vec3_origin,(Vector *)&local_40,0xff,0xff,0,0,
10.0);
NDebugOverlay::Cross3D(pVVar6,8.0,0xff,0,0,false,10.0);
return;
}
cVar1 = FindRow((Vector *)&local_64,(Vector *)&local_58,0,pVVar6,(float)pVVar7);
if ((cVar1 == '\0') ||
(cVar1 = FindArea((Vector *)&local_64,(Vector *)&local_58,0,1,(float)pVVar7), cVar1 == '\0')) {
local_80 = (CUtlMemory<Extent,int> *)0x0;
}
else {
local_80 = (CUtlMemory<Extent,int> *)((local_58 - local_64) * (local_54 - local_60));
}
cVar1 = FindRow((Vector *)&local_4c,(Vector *)&local_40,1,pVVar6,(float)pVVar7);
if (cVar1 != '\0') {
pVVar6 = (Vector *)0x0;
cVar1 = FindArea((Vector *)&local_4c,(Vector *)&local_40,1,0,(float)pVVar7);
if (cVar1 != '\0') {
local_34 = 0.0;
local_30 = 0.0;
local_2c = 0.0;
local_28 = 0.0;
local_24 = 0.0;
fVar5 = (local_3c - local_48) * (local_40 - local_4c);
if (((float)local_80 < fVar5) && (0.0 < fVar5)) {
/* try { // try from 00711cb2 to 00711cb6 has its CatchHandler @ 00711cbc */
AddAreaIfUnique((CUtlVector *)&local_34,(Vector *)&local_4c,(Vector *)&local_40,
(float)pVVar6);
goto LAB_00711b87;
}
}
}
local_24 = 0.0;
local_28 = 0.0;
local_2c = 0.0;
local_30 = 0.0;
local_34 = 0.0;
if (0.0 < (float)local_80) {
/* try { // try from 00711b82 to 00711bbb has its CatchHandler @ 00711cbc */
AddAreaIfUnique((CUtlVector *)&local_34,(Vector *)&local_64,(Vector *)&local_58,(float)pVVar6);
}
LAB_00711b87:
local_80 = (CUtlMemory<Extent,int> *)&local_34;
iVar3 = 0;
if (0 < (int)local_28) {
iVar4 = 0;
do {
pCVar2 = (CNavArea *)
CreateNavArea(this,(Vector *)((int)local_34 + iVar4),
(Vector *)((int)local_34 + iVar4) + 0xc);
AddToSelectedSet(this,pCVar2);
iVar3 = iVar3 + 1;
iVar4 = iVar4 + 0x18;
} while (iVar3 < (int)local_28);
}
local_28 = 0.0;
CUtlMemory<Extent,int>::Purge(local_80);
local_24 = local_34;
CUtlMemory<Extent,int>::Purge(local_80);
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.