L L4D2node

CNavMesh::DestroyNavigationMesh

0x00741850 · 707 bytes · __thiscall

_ZN8CNavMesh21DestroyNavigationMeshEb

Decompiled

undefined (2 params)

/* CNavMesh::DestroyNavigationMesh(bool) */

void __thiscall CNavMesh::DestroyNavigationMesh(CNavMesh *this,bool param_1)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  char cVar3;
  int *piVar4;
  int iVar5;
  uint uVar6;
  int iVar7;
  int local_20;
  
  *(undefined4 *)(this + 0x5bc) = 0;
  *(undefined4 *)(this + 0x594) = 0;
  if (param_1) {
    iVar7 = 0;
    if (0 < DAT_00fe6000) {
      do {
        puVar1 = TheNavAreas + iVar7;
        iVar7 = iVar7 + 1;
        CNavArea::ResetNodes((CNavArea *)*puVar1);
      } while (iVar7 < DAT_00fe6000);
    }
    DestroyHidingSpots();
    CNavNode::CleanupGeneration();
  }
  else {
    CNavArea::m_isReset = 1;
    if (0 < DAT_00fe6000) {
      local_20 = 0;
      do {
        iVar7 = 1;
        uVar2 = TheNavAreas[local_20];
        if (0 < *(int *)(gpGlobals + 0x14)) {
          do {
            piVar4 = (int *)UTIL_PlayerByIndex(iVar7);
            if ((((piVar4 != (int *)0x0) && (piVar4[0xc] != 0)) &&
                (piVar4[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
               (((cVar3 = (**(code **)(*piVar4 + 0x16c))(piVar4), cVar3 != '\0' &&
                 (piVar4[0x7db] != 2)) &&
                (iVar5 = (**(code **)(*piVar4 + 0x148))(piVar4), iVar5 == 0)))) {
              (**(code **)(*piVar4 + 0x540))(piVar4,uVar2);
            }
            iVar7 = iVar7 + 1;
          } while (iVar7 <= *(int *)(gpGlobals + 0x14));
        }
        iVar7 = TheNextBots();
        uVar6 = (uint)*(ushort *)(iVar7 + 0x10);
        if (uVar6 != 0xffff) {
          iVar5 = *(int *)(iVar7 + 4);
          do {
            piVar4 = *(int **)(iVar5 + uVar6 * 8);
            piVar4 = (int *)(**(code **)(*piVar4 + 0xb4))(piVar4);
            (**(code **)(*piVar4 + 0x540))(piVar4,uVar2);
            iVar5 = *(int *)(iVar7 + 4);
            uVar6 = (uint)*(ushort *)(iVar5 + 6 + uVar6 * 8);
          } while (uVar6 != 0xffff);
        }
        local_20 = local_20 + 1;
      } while (local_20 < DAT_00fe6000);
    }
    while (DAT_00fe6000 != 0) {
      (**(code **)(*(int *)this + 0x18))(this,*TheNavAreas);
    }
    CNavArea::m_isReset = 0;
    DestroyLadders(this);
    DestroyHidingSpots();
    CNavNode::CleanupGeneration();
    CUtlVector<CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>,CUtlMemory<CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>,int>>
    ::RemoveAll((CUtlVector<CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>,CUtlMemory<CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>,int>>
                 *)(this + 0xc));
    *(undefined4 *)(this + 0x24) = 0;
    *(undefined4 *)(this + 0x28) = 0;
  }
  iVar7 = 0;
  do {
    *(undefined4 *)(this + iVar7 * 4 + 0x50) = 0;
    iVar7 = iVar7 + 1;
  } while (iVar7 != 0x100);
  if (param_1) {
    SetEditMode(this,0);
    this[0x494] = (CNavMesh)0x0;
    *(undefined4 *)(this + 0x470) = 0;
    *(undefined4 *)(this + 0x474) = 0;
    *(undefined4 *)(this + 0x478) = 0;
    *(undefined4 *)(this + 0x4c4) = 0;
    *(undefined4 *)(this + 0x4bc) = 0;
    this[9] = (CNavMesh)0x0;
    this[10] = (CNavMesh)0x0;
    return;
  }
  *(undefined4 *)(this + 0x34) = 0;
  CNavArea::CompressIDs();
  CNavLadder::CompressIDs();
  SetEditMode(this,0);
  this[0x494] = (CNavMesh)0x0;
  *(undefined4 *)(this + 0x470) = 0;
  *(undefined4 *)(this + 0x474) = 0;
  *(undefined4 *)(this + 0x478) = 0;
  *(undefined4 *)(this + 0x4c4) = 0;
  *(undefined4 *)(this + 0x4bc) = 0;
  this[9] = (CNavMesh)0x0;
  this[10] = (CNavMesh)0x0;
  this[0x4c] = (CNavMesh)0x0;
  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)