L L4D2node

CNavMesh::ConnectAreaEdge

0x00724e70 · 329 bytes · __thiscall

_ZN8CNavMesh15ConnectAreaEdgeEP8CNavArea10NavDirType

Decompiled

undefined (3 params)

/* CNavMesh::ConnectAreaEdge(CNavArea*, NavDirType) */

void __thiscall CNavMesh::ConnectAreaEdge(undefined4 this,CNavArea *param_1,uint param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  CNavArea *pCVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  
  iVar7 = 0;
  if (param_3 < 4) {
    iVar7 = (&CSWTCH_1514)[param_3];
  }
  iVar6 = *(int *)(param_1 +
                  *(int *)(ConnectAreaEdge(CNavArea*,NavDirType)::startCorner + param_3 * 4) * 4 +
                  0xec);
  iVar1 = *(int *)(ConnectAreaEdge(CNavArea*,NavDirType)::endCorner + param_3 * 4);
  if (iVar6 != *(int *)(param_1 + iVar1 * 4 + 0xec)) {
    iVar2 = *(int *)(ConnectAreaEdge(CNavArea*,NavDirType)::stepDir + param_3 * 4);
    do {
      iVar3 = *(int *)(iVar6 + 8 + (param_3 + 4) * 4);
      if (iVar3 == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(iVar3 + 0x74);
      }
      if (param_3 != 3 && param_3 != 0) {
        iVar5 = *(int *)(iVar6 + 0x74);
      }
      if (((iVar5 == 0) || (iVar3 == 0)) || (iVar6 != *(int *)(iVar3 + 0x18 + iVar7 * 4))) {
        if (((((*(char *)(iVar6 + 0x78 +
                         *(int *)(CNavNode::IsBlockedInDirection(NavDirType)::s_TestType +
                                 param_3 * 8)) == '\0') &&
              (*(char *)(iVar6 + 0x78 +
                        *(int *)(CNavNode::IsBlockedInDirection(NavDirType)::s_TestType +
                                param_3 * 8 + 4)) == '\0')) &&
             ((iVar3 == 0 ||
              ((*(char *)(iVar3 + 0x78 +
                         *(int *)(CNavNode::IsBlockedInDirection(NavDirType)::s_TestType + iVar7 * 8
                                 )) == '\0' &&
               (*(char *)(iVar3 + 0x78 +
                         *(int *)(CNavNode::IsBlockedInDirection(NavDirType)::s_TestType +
                                 iVar7 * 8 + 4)) == '\0')))))) &&
            (pCVar4 = (CNavArea *)findJumpDownArea(iVar6,param_1,param_3), param_1 != pCVar4)) &&
           (pCVar4 != (CNavArea *)0x0)) {
          CNavArea::ConnectTo(param_1,pCVar4,param_3);
        }
      }
      else {
        CNavArea::ConnectTo(param_1,iVar5,param_3);
      }
      iVar6 = *(int *)(iVar6 + 8 + (iVar2 + 4) * 4);
    } while (*(int *)(param_1 + iVar1 * 4 + 0xec) != iVar6);
  }
  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)