L L4D2node

CNavMesh::GetNavAreasInBox

0x00741e70 · 527 bytes · __thiscall

_ZN8CNavMesh16GetNavAreasInBoxER10CUtlVectorIP8CNavArea10CUtlMemoryIS2_iEERK6VectorS9_

Decompiled

undefined (4 params)

/* CNavMesh::GetNavAreasInBox(CUtlVector<CNavArea*, CUtlMemory<CNavArea*, int> >&, Vector const&,
   Vector const&) */

void __thiscall
CNavMesh::GetNavAreasInBox(CNavMesh *this,CUtlVector *param_1,Vector *param_2,Vector *param_3)

{
  int *piVar1;
  int iVar2;
  CNavArea *pCVar3;
  char cVar4;
  int iVar5;
  CNavArea **ppCVar6;
  int iVar7;
  float fVar8;
  int local_54;
  int local_50;
  int local_4c;
  int local_48;
  int local_44;
  float local_34;
  float local_30;
  undefined4 local_2c;
  float local_28;
  float local_24;
  undefined4 local_20;
  
  local_34 = *(float *)param_2;
  fVar8 = 1.0 / *(float *)(this + 0x20);
  iVar7 = (int)((local_34 - *(float *)(this + 0x2c)) * fVar8);
  if (iVar7 < 0) {
    local_54 = 0;
  }
  else {
    local_54 = *(int *)(this + 0x24) + -1;
    if (iVar7 < *(int *)(this + 0x24)) {
      local_54 = iVar7;
    }
  }
  local_30 = *(float *)(param_2 + 4);
  iVar7 = (int)((local_30 - *(float *)(this + 0x30)) * fVar8);
  if (iVar7 < 0) {
    local_48 = 0;
  }
  else {
    local_48 = *(int *)(this + 0x28) + -1;
    if (iVar7 < *(int *)(this + 0x28)) {
      local_48 = iVar7;
    }
  }
  local_28 = *(float *)param_3;
  iVar7 = (int)((local_28 - *(float *)(this + 0x2c)) * fVar8);
  if (iVar7 < 0) {
    local_4c = 0;
  }
  else {
    local_4c = *(int *)(this + 0x24) + -1;
    if (iVar7 < *(int *)(this + 0x24)) {
      local_4c = iVar7;
    }
  }
  local_24 = *(float *)(param_3 + 4);
  iVar7 = (int)((local_24 - *(float *)(this + 0x30)) * fVar8);
  if (iVar7 < 0) {
    local_50 = 0;
  }
  else {
    local_50 = *(int *)(this + 0x28) + -1;
    if (iVar7 < *(int *)(this + 0x28)) {
      local_50 = iVar7;
    }
  }
  local_2c = *(undefined4 *)(param_2 + 8);
  local_20 = *(undefined4 *)(param_3 + 8);
  if (*(int *)(this + 0x18) != 0) {
    for (; local_48 <= local_50; local_48 = local_48 + 1) {
      if (local_54 <= local_4c) {
        local_44 = local_54;
        do {
          iVar7 = 0;
          piVar1 = (int *)(*(int *)(this + 0xc) +
                          (local_48 * *(int *)(this + 0x24) + local_44) * 0x14);
          if (0 < piVar1[3]) {
            do {
              cVar4 = CNavArea::IsOverlapping
                                (*(CNavArea **)(*piVar1 + iVar7 * 4),(Extent *)&local_34);
              if (cVar4 != '\0') {
                ppCVar6 = (CNavArea **)(iVar7 * 4 + *piVar1);
                iVar2 = *(int *)(param_1 + 0xc);
                if (iVar2 < 1) {
LAB_00741f98:
                  CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
                            ((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)param_1,iVar2,
                             ppCVar6);
                }
                else {
                  pCVar3 = *ppCVar6;
                  if ((CNavArea *)**(int **)param_1 != pCVar3) {
                    iVar5 = 0;
                    do {
                      iVar5 = iVar5 + 1;
                      if (iVar5 == iVar2) goto LAB_00741f98;
                    } while ((CNavArea *)(*(int **)param_1)[iVar5] != pCVar3);
                    if (iVar5 == -1) goto LAB_00741f98;
                  }
                }
              }
              iVar7 = iVar7 + 1;
            } while (iVar7 < piVar1[3]);
          }
          local_44 = local_44 + 1;
        } while (local_44 <= local_4c);
      }
    }
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)