L L4D2node

CBSPTreeData::Init

0x000bb820 · 433 bytes · __thiscall

_ZN12CBSPTreeData4InitEP13ISpatialQuery

Decompiled

undefined (2 params)

/* CBSPTreeData::Init(ISpatialQuery*) */

void __thiscall CBSPTreeData::Init(CBSPTreeData *this,ISpatialQuery *param_1)

{
  void *pvVar1;
  int iVar2;
  undefined2 local_1e [7];
  
  *(ISpatialQuery **)(this + 0x70) = param_1;
  if ((*(int *)(this + 0x20) < 0x400) && (-1 < *(int *)(this + 0x24))) {
    *(undefined4 *)(this + 0x20) = 0x400;
    if (*(void **)(this + 0x1c) == (void *)0x0) {
      pvVar1 = malloc(0x3000);
      *(void **)(this + 0x1c) = pvVar1;
      goto LAB_000bb8b3;
    }
    pvVar1 = realloc(*(void **)(this + 0x1c),0x3000);
    *(void **)(this + 0x1c) = pvVar1;
    *(void **)(this + 0x34) = pvVar1;
    if (*(int *)(this + 0x3c) < 0x400) goto LAB_000bb8bf;
LAB_000bb873:
    pvVar1 = *(void **)(this + 0x38);
  }
  else {
    pvVar1 = *(void **)(this + 0x1c);
LAB_000bb8b3:
    *(void **)(this + 0x34) = pvVar1;
    if (0x3ff < *(int *)(this + 0x3c)) goto LAB_000bb873;
LAB_000bb8bf:
    if (*(int *)(this + 0x40) < 0) goto LAB_000bb873;
    *(undefined4 *)(this + 0x3c) = 0x400;
    if (*(void **)(this + 0x38) != (void *)0x0) {
      pvVar1 = realloc(*(void **)(this + 0x38),0x1800);
      iVar2 = *(int *)(this + 0x58);
      *(void **)(this + 0x38) = pvVar1;
      *(void **)(this + 0x50) = pvVar1;
      goto joined_r0x000bb8f5;
    }
    pvVar1 = malloc(0x1800);
    *(void **)(this + 0x38) = pvVar1;
  }
  iVar2 = *(int *)(this + 0x58);
  *(void **)(this + 0x50) = pvVar1;
joined_r0x000bb8f5:
  if ((iVar2 < 0x400) && (-1 < *(int *)(this + 0x5c))) {
    *(undefined4 *)(this + 0x58) = 0x400;
    if (*(void **)(this + 0x54) == (void *)0x0) {
      pvVar1 = malloc(0x3000);
      *(void **)(this + 0x54) = pvVar1;
    }
    else {
      pvVar1 = realloc(*(void **)(this + 0x54),0x3000);
      *(void **)(this + 0x54) = pvVar1;
    }
  }
  else {
    pvVar1 = *(void **)(this + 0x54);
  }
  *(void **)(this + 0x6c) = pvVar1;
  iVar2 = (**(code **)**(undefined4 **)(this + 0x70))(*(undefined4 **)(this + 0x70));
  if ((*(int *)(this + 0xc) < iVar2) && (-1 < *(int *)(this + 0x10))) {
    *(int *)(this + 0xc) = iVar2;
    if (*(void **)(this + 8) == (void *)0x0) {
      pvVar1 = malloc(iVar2 * 2);
      *(void **)(this + 8) = pvVar1;
    }
    else {
      pvVar1 = realloc(*(void **)(this + 8),iVar2 * 2);
      *(void **)(this + 8) = pvVar1;
    }
  }
  else {
    pvVar1 = *(void **)(this + 8);
  }
  *(void **)(this + 0x18) = pvVar1;
  iVar2 = iVar2 + -1;
  local_1e[0] = 0xffff;
  if (-1 < iVar2) {
    do {
      iVar2 = iVar2 + -1;
      CUtlVector<CBSPTreeData::Leaf_t,CUtlMemory<CBSPTreeData::Leaf_t,int>>::InsertBefore
                ((CUtlVector<CBSPTreeData::Leaf_t,CUtlMemory<CBSPTreeData::Leaf_t,int>> *)(this + 8)
                 ,*(int *)(this + 0x14),(Leaf_t *)local_1e);
    } while (iVar2 != -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)