L L4D2node

CNavArea::AddLadderDown

0x006fb690 · 281 bytes · __thiscall

_ZN8CNavArea13AddLadderDownEP10CNavLadder

Decompiled

undefined (2 params)

/* CNavArea::AddLadderDown(CNavLadder*) */

void __thiscall CNavArea::AddLadderDown(CNavArea *this,CNavLadder *param_1)

{
  size_t __size;
  int iVar1;
  int *piVar2;
  void *pvVar3;
  undefined4 *puVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int local_20;
  
  iVar7 = 0;
  do {
    piVar2 = *(int **)(this + iVar7 * 4 + 0x68);
    iVar6 = *piVar2;
    if (0 < iVar6) {
      if (param_1 == (CNavLadder *)piVar2[1]) {
        local_20 = 0;
      }
      else {
        iVar5 = 0;
        do {
          local_20 = iVar5 + 1;
          if (local_20 == iVar6) goto LAB_006fb6cd;
          iVar1 = iVar5 + 2;
          iVar5 = local_20;
        } while (param_1 != (CNavLadder *)piVar2[iVar1]);
      }
      iVar5 = (iVar6 - local_20) + -1;
      if (0 < iVar5) {
        _V_memmove(piVar2 + local_20 + 1,piVar2 + local_20 + 2,iVar5 * 4);
        piVar2 = *(int **)(this + iVar7 * 4 + 0x68);
        iVar6 = *piVar2;
      }
      *piVar2 = iVar6 + -1;
      if (**(int **)(this + iVar7 * 4 + 0x68) == 0) {
        free(*(int **)(this + iVar7 * 4 + 0x68));
        *(undefined4 **)(this + iVar7 * 4 + 0x68) =
             &CUtlVectorUltraConservative<NavLadderConnect,CUtlVectorUltraConservativeAllocator>::
              StaticData()::staticData;
      }
    }
LAB_006fb6cd:
    iVar7 = iVar7 + 1;
    if (iVar7 == 2) {
      piVar2 = *(int **)(this + 0x6c);
      iVar6 = *piVar2;
      iVar7 = iVar6 + 1;
      if (piVar2 == &CUtlVectorUltraConservative<NavLadderConnect,CUtlVectorUltraConservativeAllocator>
                     ::StaticData()::staticData) {
        puVar4 = malloc(iVar7 * 4 + 4);
        *(undefined4 **)(this + 0x6c) = puVar4;
        *puVar4 = 0;
        pvVar3 = *(void **)(this + 0x6c);
      }
      else {
        __size = iVar7 * 4 + 4;
        iVar7 = malloc_usable_size(piVar2);
        if (iVar7 < (int)__size) {
          pvVar3 = realloc(*(void **)(this + 0x6c),__size);
          *(void **)(this + 0x6c) = pvVar3;
        }
        else {
          pvVar3 = *(void **)(this + 0x6c);
        }
      }
      *(CNavLadder **)((int)pvVar3 + iVar6 * 4 + 4) = param_1;
      **(int **)(this + 0x6c) = **(int **)(this + 0x6c) + 1;
      return;
    }
  } while( true );
}

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)