CNavMesh::SplitAreasUnderOverhangs
0x00725540 · 1277 bytes · __cdecl
_ZN8CNavMesh24SplitAreasUnderOverhangsEv
Decompiled
undefined (0 params)
/* CNavMesh::SplitAreasUnderOverhangs() */
void CNavMesh::SplitAreasUnderOverhangs(void)
{
CNavArea *this;
bool bVar1;
CNavArea *pCVar2;
char cVar3;
char cVar4;
char cVar5;
int *piVar6;
undefined4 uVar7;
CNavArea *pCVar8;
int iVar9;
int iVar10;
bool bVar11;
float fVar12;
float fVar13;
float fVar14;
int local_ac;
undefined4 local_a0;
uint local_9c;
CNavArea *local_98;
uint local_90;
CNavArea *local_84;
CNavArea *local_80;
Extent local_7c [8];
float local_74;
float local_68;
Extent local_64 [8];
float local_5c;
float local_50;
float local_4c;
float local_48;
float local_40;
float local_3c;
float local_34;
float local_30;
float local_28;
float local_24;
iVar10 = DAT_00fe6000;
LAB_00725560:
do {
local_ac = 0;
bVar1 = false;
bVar11 = false;
if (0 < iVar10) {
do {
if (bVar1) goto LAB_00725560;
iVar10 = 0;
this = *(CNavArea **)(TheNavAreas + local_ac * 4);
CNavArea::GetExtent(this,local_7c);
do {
piVar6 = *(int **)(this + iVar10 * 4 + 0x58);
if (*piVar6 < 1) {
bVar1 = false;
bVar11 = true;
}
else {
iVar9 = 0;
do {
while( true ) {
local_98 = (CNavArea *)piVar6[iVar9 * 2 + 1];
CNavArea::GetExtent(local_98,local_64);
cVar3 = CNavArea::IsOverlapping(this,local_98);
bVar1 = false;
if (cVar3 != '\0') break;
LAB_00725898:
iVar9 = iVar9 + 1;
piVar6 = *(int **)(this + iVar10 * 4 + 0x58);
if (*piVar6 <= iVar9) goto LAB_00725650;
if (bVar1) goto LAB_007258b5;
}
if ((local_50 + 55.0 < local_74) || (local_68 + 55.0 < local_5c)) {
local_90 = (&CSWTCH_1514)[iVar10];
pCVar2 = this;
pCVar8 = local_98;
if (local_74 <= local_5c) {
joined_r0x00725935:
local_98 = pCVar2;
if (local_90 < 4) {
bVar11 = local_90 == 3;
local_9c = local_90 & 0xfffffffd;
goto LAB_00725951;
}
local_9c = local_90 & 0xfffffffd;
bVar11 = false;
local_a0 = 0;
}
else {
pCVar8 = this;
if (local_90 < 4) {
local_90 = (&CSWTCH_1514)[local_90];
pCVar2 = local_98;
goto joined_r0x00725935;
}
local_9c = 0;
bVar11 = false;
local_90 = 0;
LAB_00725951:
local_a0 = (&CSWTCH_1514)[local_90];
}
CNavArea::GetExtent(local_98,(Extent *)&local_4c);
CNavArea::GetExtent(pCVar8,(Extent *)&local_34);
if (local_9c == 1) {
fVar14 = local_40 - local_4c;
if (local_40 <= local_28) {
local_9c._0_1_ = false;
fVar13 = local_40 - local_34;
fVar12 = local_34;
}
else {
local_9c._0_1_ = false;
fVar13 = local_28 - local_4c;
fVar12 = local_28;
}
}
else {
fVar14 = local_3c - local_48;
if (local_3c <= local_24) {
local_9c._0_1_ = true;
fVar13 = local_3c - local_30;
fVar12 = local_30;
}
else {
local_9c._0_1_ = true;
fVar13 = local_24 - local_48;
fVar12 = local_24;
}
}
if (fVar13 < 25.0) {
if ((fVar14 <= 50.0) || (fVar13 < 7.5)) goto LAB_0072563d;
if ((local_90 == 0) || (fVar14 = 1.0, bVar11)) {
fVar14 = -1.0;
}
fVar12 = fVar12 + (25.0 - fVar13) * fVar14;
}
cVar3 = CNavArea::IsConnected(local_98,pCVar8,local_a0);
if (cVar3 != '\0') {
CNavArea::Disconnect(local_98,pCVar8);
}
cVar4 = CNavArea::IsConnected(pCVar8,local_98,local_90);
if (cVar4 != '\0') {
CNavArea::Disconnect(pCVar8,local_98);
}
local_84 = (CNavArea *)0x0;
local_80 = (CNavArea *)0x0;
cVar5 = CNavArea::SplitEdit(local_98,local_9c._0_1_,fVar12,&local_84,&local_80);
bVar1 = false;
if (cVar5 != '\0') {
pCVar2 = local_84;
if ((local_90 != 0) && (!bVar11)) {
pCVar2 = local_80;
}
if (cVar4 != '\0') {
CNavArea::ConnectTo(pCVar8,pCVar2,local_90);
}
bVar1 = true;
if (cVar3 != '\0') {
uVar7 = 0;
if (local_90 < 4) {
uVar7 = (&CSWTCH_1514)[local_90];
}
CNavArea::ConnectTo(local_98,pCVar2,uVar7);
bVar1 = true;
}
}
goto LAB_00725898;
}
LAB_0072563d:
iVar9 = iVar9 + 1;
piVar6 = *(int **)(this + iVar10 * 4 + 0x58);
} while (iVar9 < *piVar6);
bVar1 = false;
LAB_00725650:
bVar11 = (bool)(bVar1 ^ 1);
}
iVar10 = iVar10 + 1;
} while ((bVar11) && (iVar10 < 4));
LAB_007258b5:
local_ac = local_ac + 1;
iVar10 = DAT_00fe6000;
bVar11 = bVar1;
} while (local_ac < DAT_00fe6000);
}
if (!bVar11) {
return;
}
} 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.