L L4D2node

CNavMesh::CommandNavDisconnect

0x0070c750 · 784 bytes · __thiscall

_ZN8CNavMesh20CommandNavDisconnectEv

Decompiled

undefined (1 param)

/* CNavMesh::CommandNavDisconnect() */

void __thiscall CNavMesh::CommandNavDisconnect(CNavMesh *this)

{
  CNavArea *pCVar1;
  CNavArea *pCVar2;
  char cVar3;
  CBaseEntity *this_00;
  int iVar4;
  int iVar5;
  
  cVar3 = TestFilesWritable(this);
  if (cVar3 == '\0') {
    return;
  }
  this_00 = (CBaseEntity *)UTIL_GetListenServerHost();
  if (this_00 == (CBaseEntity *)0x0) {
    return;
  }
  if (*(int *)(this + 0x458) != 0) {
    return;
  }
  iVar4 = 1;
  FindActiveNavArea(this);
  iVar5 = *(int *)(this + 0x4e0);
  if (iVar5 < 2) {
    pCVar2 = *(CNavArea **)(this + 0x474);
    if (pCVar2 == (CNavArea *)0x0) {
      if (*(CNavLadder **)(this + 0x4bc) == (CNavLadder *)0x0) goto LAB_0070c81d;
      if (*(CNavArea **)(this + 0x470) != (CNavArea *)0x0) {
        CNavArea::Disconnect(*(CNavArea **)(this + 0x470),*(CNavLadder **)(this + 0x4bc));
        CNavLadder::Disconnect(*(CNavLadder **)(this + 0x4bc),*(CNavArea **)(this + 0x470));
        CBaseEntity::EmitSound(this_00,"EDIT_DISCONNECT.MarkedArea",0.0,(float *)0x0);
        iVar5 = *(int *)(this + 0x4e0);
      }
      if (iVar5 != 1) {
LAB_0070c9c8:
        Msg(
           "To disconnect areas, mark an area, highlight a second area, then invoke the disconnect command. This will remove all connections between the two areas."
           );
        CBaseEntity::EmitSound(this_00,"EDIT_DISCONNECT.NoMarkedArea",0.0,(float *)0x0);
        goto LAB_0070c81d;
      }
      CNavArea::Disconnect
                ((CNavArea *)**(undefined4 **)(this + 0x4d4),*(CNavLadder **)(this + 0x4bc));
      CNavLadder::Disconnect
                (*(CNavLadder **)(this + 0x4bc),(CNavArea *)**(undefined4 **)(this + 0x4d4));
    }
    else if (*(CNavArea **)(this + 0x470) == (CNavArea *)0x0) {
      if (iVar5 == 1) {
        CNavArea::Disconnect((CNavArea *)**(undefined4 **)(this + 0x4d4),pCVar2);
        CNavArea::Disconnect
                  (*(CNavArea **)(this + 0x474),(CNavArea *)**(undefined4 **)(this + 0x4d4));
      }
      else {
        if (*(CNavLadder **)(this + 0x4c4) == (CNavLadder *)0x0) goto LAB_0070c9c8;
        CNavLadder::Disconnect(*(CNavLadder **)(this + 0x4c4),pCVar2);
        CNavArea::Disconnect(*(CNavArea **)(this + 0x474),*(CNavLadder **)(this + 0x4c4));
      }
    }
    else {
      CNavArea::Disconnect(*(CNavArea **)(this + 0x470),pCVar2);
      CNavArea::Disconnect(*(CNavArea **)(this + 0x474),*(CNavArea **)(this + 0x470));
    }
  }
  else {
    do {
      pCVar2 = (CNavArea *)**(undefined4 **)(this + 0x4d4);
      pCVar1 = (CNavArea *)(*(undefined4 **)(this + 0x4d4))[iVar4];
      cVar3 = CNavArea::IsConnected(pCVar2,pCVar1,4);
      if ((cVar3 == '\0') && (cVar3 = CNavArea::IsConnected(pCVar1,pCVar2,4), cVar3 == '\0')) {
        CBaseEntity::EmitSound(this_00,"EDIT_CONNECT.AllDirections",0.0,(float *)0x0);
        goto LAB_0070c81d;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < *(int *)(this + 0x4e0));
    if (1 < *(int *)(this + 0x4e0)) {
      iVar5 = 1;
      do {
        pCVar2 = (CNavArea *)**(undefined4 **)(this + 0x4d4);
        pCVar1 = (CNavArea *)(*(undefined4 **)(this + 0x4d4))[iVar5];
        iVar5 = iVar5 + 1;
        CNavArea::Disconnect(pCVar2,pCVar1);
        CNavArea::Disconnect(pCVar1,pCVar2);
      } while (iVar5 < *(int *)(this + 0x4e0));
    }
  }
  CBaseEntity::EmitSound(this_00,"EDIT_DISCONNECT.MarkedArea",0.0,(float *)0x0);
LAB_0070c81d:
  *(undefined4 *)(this + 0x4e0) = 0;
  *(undefined4 *)(this + 0x470) = 0;
  *(undefined4 *)(this + 0x474) = 0;
  *(undefined4 *)(this + 0x478) = 0;
  *(undefined4 *)(this + 0x4bc) = 0;
  *(undefined4 *)(this + 0x4c0) = 0;
  *(undefined4 *)(this + 0x4c4) = 0;
  *(undefined4 *)(this + 0x47c) = 4;
  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)