L L4D2node

CNavArea::ConnectTo

0x006fb7c0 · 234 bytes · __thiscall

_ZN8CNavArea9ConnectToEP10CNavLadder

Decompiled

undefined (2 params)

/* CNavArea::ConnectTo(CNavLadder*) */

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

{
  float fVar1;
  float fVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int local_20;
  
  iVar7 = 0;
  fVar1 = *(float *)(param_1 + 0x18);
  fVar2 = *(float *)(param_1 + 0xc);
  do {
    piVar4 = *(int **)(this + iVar7 * 4 + 0x68);
    iVar6 = *piVar4;
    if (0 < iVar6) {
      if (param_1 == (CNavLadder *)piVar4[1]) {
        local_20 = 0;
      }
      else {
        iVar5 = 0;
        do {
          local_20 = iVar5 + 1;
          if (local_20 == iVar6) goto LAB_006fb80d;
          iVar3 = iVar5 + 2;
          iVar5 = local_20;
        } while (param_1 != (CNavLadder *)piVar4[iVar3]);
      }
      iVar5 = (iVar6 - local_20) + -1;
      if (0 < iVar5) {
        _V_memmove(piVar4 + local_20 + 1,piVar4 + local_20 + 2,iVar5 * 4);
        piVar4 = *(int **)(this + iVar7 * 4 + 0x68);
        iVar6 = *piVar4;
      }
      *piVar4 = 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_006fb80d:
    iVar7 = iVar7 + 1;
    if (iVar7 == 2) {
      if ((fVar1 + fVar2) * 0.5 < *(float *)(this + 0x34)) {
        AddLadderDown(this,param_1);
        return;
      }
      AddLadderUp(this,param_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)