CNavMesh::RemoveOverlappingObstacleTopAreas
0x0072d3d0 · 754 bytes · __thiscall
_ZN8CNavMesh33RemoveOverlappingObstacleTopAreasEv
Decompiled
undefined (1 param)
/* CNavMesh::RemoveOverlappingObstacleTopAreas() */
void __thiscall CNavMesh::RemoveOverlappingObstacleTopAreas(CNavMesh *this)
{
char cVar1;
CNavArea **ppCVar2;
int iVar3;
int iVar4;
float fVar5;
CUtlMemory<CNavArea*,int> *local_74;
int local_70;
CNavArea *local_68;
CNavArea *local_64;
CNavArea *local_60;
Vector local_5c [8];
float local_54;
CNavArea *local_50 [2];
float local_48;
int local_44;
undefined4 local_40;
undefined4 local_3c;
int local_38;
int local_34;
undefined4 *local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
undefined4 *local_20;
local_44 = 0;
local_40 = 0;
local_3c = 0;
local_38 = 0;
local_34 = 0;
if (0 < DAT_00fe6000) {
iVar3 = 0;
iVar4 = 0;
do {
local_30 = *(undefined4 **)(TheNavAreas + iVar4 * 4);
if ((*(byte *)((int)local_30 + 0x55) & 0x40) == 0) {
if (DAT_00fe6000 <= iVar4 + 1) goto LAB_0072d45a;
}
else {
/* try { // try from 0072d447 to 0072d44b has its CatchHandler @ 0072d6ea */
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_44,iVar3,
(CNavArea **)&local_30);
iVar3 = local_38;
if (DAT_00fe6000 <= iVar4 + 1) goto LAB_0072d45a;
}
iVar4 = iVar4 + 1;
} while( true );
}
local_30 = (undefined4 *)0x0;
local_2c = 0;
local_28 = 0;
local_20 = (undefined4 *)0x0;
goto LAB_0072d5da;
LAB_0072d45a:
local_30 = (undefined4 *)0x0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = (undefined4 *)0x0;
if (0 < iVar3) {
local_70 = 0;
do {
iVar3 = local_70 * 4;
local_68 = *(CNavArea **)(local_44 + local_70 * 4);
/* try { // try from 0072d4b5 to 0072d69d has its CatchHandler @ 0072d6cd */
CNavArea::ComputeNormal(local_68,local_5c,false);
CNavArea::ComputeNormal(local_68,(Vector *)local_50,true);
fVar5 = local_48;
if (local_54 <= local_48) {
fVar5 = local_54;
}
if (fVar5 < *(float *)(nav_slope_limit._28_4_ + 0x2c)) {
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_30,local_24,&local_68);
}
local_70 = local_70 + 1;
if (local_38 <= local_70) break;
iVar3 = iVar3 + 4;
iVar4 = local_70;
do {
while( true ) {
local_64 = *(CNavArea **)(local_44 + iVar3);
cVar1 = CNavArea::IsOverlapping(local_68,local_64);
if (cVar1 == '\0') break;
cVar1 = CNavArea::Contains(local_68,local_64);
if (cVar1 == '\0') {
cVar1 = CNavArea::Contains(local_64,local_68);
if (cVar1 == '\0') {
local_60 = local_68;
if ((*(float *)(local_64 + 0x14) - *(float *)(local_64 + 8)) *
(*(float *)(local_64 + 0x10) - *(float *)(local_64 + 4)) <
(*(float *)(local_68 + 0x14) - *(float *)(local_68 + 8)) *
(*(float *)(local_68 + 0x10) - *(float *)(local_68 + 4))) {
local_60 = local_64;
}
ppCVar2 = &local_60;
}
else {
ppCVar2 = &local_68;
}
}
else {
ppCVar2 = &local_64;
}
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_30,local_24,ppCVar2);
iVar4 = iVar4 + 1;
iVar3 = iVar3 + 4;
if (local_38 <= iVar4) goto LAB_0072d56e;
}
iVar4 = iVar4 + 1;
iVar3 = iVar3 + 4;
} while (iVar4 < local_38);
LAB_0072d56e:
} while (local_70 < local_38);
while (0 < local_24) {
local_50[0] = (CNavArea *)*local_30;
RemoveFromSelectedSet((CNavArea *)this);
(**(code **)(*TheNavMesh + 0x70))(TheNavMesh,local_50[0]);
(**(code **)(*TheNavMesh + 0x18))(TheNavMesh,local_50[0]);
do {
cVar1 = CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::FindAndRemove
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_30,local_50);
} while (cVar1 != '\0');
}
}
LAB_0072d5da:
local_74 = (CUtlMemory<CNavArea*,int> *)&local_44;
local_24 = 0;
CUtlMemory<CNavArea*,int>::Purge((CUtlMemory<CNavArea*,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CNavArea*,int>::Purge((CUtlMemory<CNavArea*,int> *)&local_30);
local_38 = 0;
CUtlMemory<CNavArea*,int>::Purge(local_74);
local_34 = local_44;
CUtlMemory<CNavArea*,int>::Purge(local_74);
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.