CFuncNavObstruction::ObstructNavAreas
0x00717d40 · 738 bytes · __thiscall
_ZN19CFuncNavObstruction16ObstructNavAreasEv
Decompiled
undefined (1 param)
/* CFuncNavObstruction::ObstructNavAreas() */
void __thiscall CFuncNavObstruction::ObstructNavAreas(CFuncNavObstruction *this)
{
int *piVar1;
CNavArea *this_00;
int iVar2;
char cVar3;
int iVar4;
int iVar5;
float fVar6;
int local_64;
int local_60;
int local_5c;
int local_58;
int local_54;
float local_4c;
float local_48;
float local_44;
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;
(**(code **)(*(int *)(this + 0x194) + 0x3c))(this + 0x194,&local_4c,&local_40);
iVar2 = TheNavMesh;
if (*(int *)(TheNavMesh + 0x18) != 0) {
if ((CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)::
searchMarker == '\0') &&
(iVar4 = __cxa_guard_acquire(&CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::searchMarker), iVar4 != 0)) {
/* try { // try from 00717fa9 to 00717fad has its CatchHandler @ 00718022 */
CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)::
searchMarker = RandomInt(0,0x100000);
__cxa_guard_release(&CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::searchMarker);
}
iVar4 = CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)::
searchMarker + 1;
if (CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)::
searchMarker + 1 == 0) {
iVar4 = CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::searchMarker + 2;
}
CNavMesh::ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::searchMarker = iVar4;
fVar6 = 1.0 / *(float *)(iVar2 + 0x20);
iVar4 = (int)((local_4c - *(float *)(iVar2 + 0x2c)) * fVar6);
if (iVar4 < 0) {
local_58 = 0;
}
else {
local_58 = *(int *)(iVar2 + 0x24) + -1;
if (iVar4 < *(int *)(iVar2 + 0x24)) {
local_58 = iVar4;
}
}
iVar4 = (int)((local_40 - *(float *)(iVar2 + 0x2c)) * fVar6);
if (iVar4 < 0) {
local_60 = 0;
}
else {
local_60 = *(int *)(iVar2 + 0x24) + -1;
if (iVar4 < *(int *)(iVar2 + 0x24)) {
local_60 = iVar4;
}
}
iVar4 = (int)((local_48 - *(float *)(iVar2 + 0x30)) * fVar6);
if (iVar4 < 0) {
local_64 = 0;
}
else {
local_64 = *(int *)(iVar2 + 0x28) + -1;
if (iVar4 < *(int *)(iVar2 + 0x28)) {
local_64 = iVar4;
}
}
iVar4 = (int)((local_3c - *(float *)(iVar2 + 0x30)) * fVar6);
if (iVar4 < 0) {
local_5c = 0;
}
else {
local_5c = *(int *)(iVar2 + 0x28) + -1;
if (iVar4 < *(int *)(iVar2 + 0x28)) {
local_5c = iVar4;
}
}
for (; local_58 <= local_60; local_58 = local_58 + 1) {
if (local_64 <= local_5c) {
iVar4 = local_64 * *(int *)(iVar2 + 0x24) + local_58;
if (*(int *)(iVar2 + 0x18) <= iVar4) {
LAB_00717f4e:
if (9 < CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::__executeCount) {
return;
}
CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)::
__executeCount =
CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::__executeCount + 1;
Warning("** Walked off of the CNavMesh::m_grid in ForAllAreasOverlappingExtent()\n");
return;
}
local_54 = local_64;
while( true ) {
iVar5 = 0;
piVar1 = (int *)(*(int *)(iVar2 + 0xc) + iVar4 * 0x14);
if (0 < piVar1[3]) {
do {
this_00 = *(CNavArea **)(*piVar1 + iVar5 * 4);
if (*(int *)(this_00 + 0x74) !=
CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::searchMarker) {
*(int *)(this_00 + 0x74) =
CNavMesh::
ForAllAreasOverlappingExtent<CFuncNavObstruction>(CFuncNavObstruction&,Extent_const&)
::searchMarker;
CNavArea::GetExtent(this_00,(Extent *)&local_34);
if ((((local_4c <= local_28) && (local_34 <= local_40)) && (local_48 <= local_24))
&& (((local_30 <= local_3c && (local_44 <= local_20)) &&
((local_2c <= local_38 && (cVar3 = operator()(this,this_00), cVar3 == '\0')))
))) {
return;
}
}
iVar5 = iVar5 + 1;
} while (iVar5 < piVar1[3]);
}
local_54 = local_54 + 1;
if (local_5c < local_54) break;
iVar4 = local_54 * *(int *)(iVar2 + 0x24) + local_58;
if (*(int *)(iVar2 + 0x18) <= iVar4) goto LAB_00717f4e;
}
}
}
}
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.