L L4D2node

CVoxelHash::RemoveFromTree

0x001ddc10 · 356 bytes · __thiscall

_ZN10CVoxelHash14RemoveFromTreeEt

Decompiled

undefined (2 params)

/* CVoxelHash::RemoveFromTree(unsigned short) */

void __thiscall CVoxelHash::RemoveFromTree(CVoxelHash *this,ushort param_1)

{
  int iVar1;
  CVoxelHash *pCVar2;
  int iVar3;
  uint *puVar4;
  undefined4 *puVar5;
  uint uVar6;
  undefined4 *puVar7;
  uint uVar8;
  uint *puVar9;
  
  iVar3 = *(int *)(this + 0x1048);
  iVar1 = (uint)param_1 * 0x34 + *(int *)(*(int *)(iVar3 + 0xbc) + 0x10) +
          *(int *)(iVar3 + 0x38) * 4;
  puVar5 = *(undefined4 **)(iVar1 + 0x28);
  while (puVar7 = puVar5, puVar7 != (undefined4 *)0x0) {
    puVar4 = (uint *)*puVar7;
    puVar5 = (undefined4 *)puVar7[3];
    if (puVar4 != (uint *)&DAT_ffffffff) {
      uVar6 = puVar7[1];
      if (puVar4[1] == uVar6) {
        if (*(uint *)(uVar6 + 8) == 0) {
          uVar8 = (*puVar4 >> 0x18) +
                  (((int)*puVar4 >> 0x10 & 0xffU) +
                  ((*puVar4 >> 8 & 0xff) + ((byte)*puVar4 + 0xaaaaaaaa) * 0x21) * 0x21) * 0x21;
          pCVar2 = this + (((int)uVar8 >> 0x10 ^ uVar8) & 0x1ff) * 8 + 0xc;
          puVar9 = (uint *)puVar4[3];
          if (puVar4 == puVar9) {
            *(undefined4 *)pCVar2 = 0;
          }
          else {
            if (puVar4 == *(uint **)pCVar2) {
              *(uint **)pCVar2 = puVar9;
              puVar9 = (uint *)puVar4[3];
            }
            puVar9[2] = puVar4[2];
            *(uint *)(puVar4[2] + 0xc) = puVar4[3];
          }
          operator_delete(puVar4);
          *(int *)(pCVar2 + 4) = *(int *)(pCVar2 + 4) + -1;
          *(int *)(this + 0x100c) = *(int *)(this + 0x100c) + -1;
        }
        else {
          puVar4[1] = *(uint *)(uVar6 + 8);
        }
      }
      CUtlLinkedList<unsigned_short,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<unsigned_short,int>>>
      ::Unlink((CUtlLinkedList<unsigned_short,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<unsigned_short,int>>>
                *)(this + 0x101c),uVar6);
      *(undefined4 *)(uVar6 + 8) = *(undefined4 *)(this + 0x1030);
      *(uint *)(this + 0x1030) = uVar6;
      CUtlLinkedList<LeafListData_t,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LeafListData_t,int>>>
      ::Unlink((CUtlLinkedList<LeafListData_t,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LeafListData_t,int>>>
                *)(iVar3 + 0xc),(int)puVar7);
      puVar7[3] = *(undefined4 *)(iVar3 + 0x20);
      *(undefined4 **)(iVar3 + 0x20) = puVar7;
    }
  }
  *(undefined4 *)(iVar1 + 0x28) = 0;
  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)