L L4D2node

CNavArea::AddIncomingConnection

0x006fba60 · 350 bytes · __thiscall

_ZN8CNavArea21AddIncomingConnectionEPS_10NavDirType

Decompiled

undefined (3 params)

/* CNavArea::AddIncomingConnection(CNavArea*, NavDirType) */

void __thiscall CNavArea::AddIncomingConnection(CNavArea *this,int param_1,int param_3)

{
  size_t __size;
  int *piVar1;
  int iVar2;
  int iVar3;
  void *pvVar4;
  undefined4 *puVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  param_3 = param_3 * 4;
  piVar1 = *(int **)(this + param_3 + 0x114);
  iVar2 = *piVar1;
  if (iVar2 < 1) {
LAB_006fbaa1:
    fVar8 = *(float *)(param_1 + 0x30) - *(float *)(this + 0x30);
    fVar6 = *(float *)(param_1 + 0x34) - *(float *)(this + 0x34);
    fVar7 = *(float *)(param_1 + 0x2c) - *(float *)(this + 0x2c);
    if (CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>::StaticData()::
        staticData == '\0') {
      iVar3 = __cxa_guard_acquire(&CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>
                                   ::StaticData()::staticData);
      if (iVar3 != 0) {
        __cxa_guard_release(&CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>
                             ::StaticData()::staticData);
      }
    }
    if (piVar1 == &CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>::
                   StaticData()::staticData) {
      puVar5 = malloc((iVar2 + 1) * 8 + 4);
      *(undefined4 **)(this + param_3 + 0x114) = puVar5;
      *puVar5 = 0;
      pvVar4 = *(void **)(this + param_3 + 0x114);
    }
    else {
      __size = (iVar2 + 1) * 8 + 4;
      iVar3 = malloc_usable_size(*(undefined4 *)(this + param_3 + 0x114));
      if (iVar3 < (int)__size) {
        pvVar4 = realloc(*(void **)(this + param_3 + 0x114),__size);
        *(void **)(this + param_3 + 0x114) = pvVar4;
      }
      else {
        pvVar4 = *(void **)(this + param_3 + 0x114);
      }
    }
    *(int *)((int)pvVar4 + iVar2 * 8 + 4) = param_1;
    *(float *)((int)pvVar4 + iVar2 * 8 + 8) = SQRT(fVar6 * fVar6 + fVar8 * fVar8 + fVar7 * fVar7);
    **(int **)(this + param_3 + 0x114) = **(int **)(this + param_3 + 0x114) + 1;
  }
  else if (param_1 != piVar1[1]) {
    iVar3 = 0;
    do {
      iVar3 = iVar3 + 1;
      if (iVar3 == iVar2) goto LAB_006fbaa1;
    } while (param_1 != piVar1[iVar3 * 2 + 1]);
  }
  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)