L L4D2node

CBSPTreeData::RemoveFromTree

0x000bbb60 · 255 bytes · __thiscall

_ZN12CBSPTreeData14RemoveFromTreeEt

Decompiled

undefined (2 params)

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

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

{
  ushort *puVar1;
  ushort uVar2;
  int iVar3;
  int local_24;
  ushort local_1e;
  
  iVar3 = (uint)param_1 * 0xc + *(int *)(this + 0x1c);
  if (*(ushort *)(iVar3 + 4) != 0xffff) {
    local_1e = *(ushort *)(iVar3 + 4);
    do {
      iVar3 = (uint)local_1e * 0xc;
      uVar2 = *(ushort *)((int *)(iVar3 + *(int *)(this + 0x54)) + 1);
      puVar1 = (ushort *)(*(int *)(this + 8) + *(int *)(iVar3 + *(int *)(this + 0x54)) * 2);
      if (uVar2 == *puVar1) {
        *puVar1 = *(ushort *)(*(int *)(this + 0x38) + 4 + (uint)uVar2 * 6);
      }
      local_24 = (uint)uVar2 * 6;
      CUtlLinkedList<unsigned_short,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<unsigned_short,unsigned_short>,unsigned_short>>
      ::Unlink((CUtlLinkedList<unsigned_short,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<unsigned_short,unsigned_short>,unsigned_short>>
                *)(this + 0x38),uVar2);
      *(undefined2 *)(*(int *)(this + 0x38) + 4 + local_24) = *(undefined2 *)(this + 0x48);
      *(ushort *)(this + 0x48) = uVar2;
      uVar2 = *(ushort *)(*(int *)(this + 0x54) + 10 + iVar3);
      CUtlLinkedList<CBSPTreeData::HandleInLeaf_t,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CBSPTreeData::HandleInLeaf_t,unsigned_short>,unsigned_short>>
      ::Unlink((CUtlLinkedList<CBSPTreeData::HandleInLeaf_t,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CBSPTreeData::HandleInLeaf_t,unsigned_short>,unsigned_short>>
                *)(this + 0x54),local_1e);
      *(undefined2 *)(*(int *)(this + 0x54) + 10 + iVar3) = *(undefined2 *)(this + 100);
      *(ushort *)(this + 100) = local_1e;
      local_1e = uVar2;
    } while (uVar2 != 0xffff);
    iVar3 = (uint)param_1 * 0xc + *(int *)(this + 0x1c);
  }
  *(undefined2 *)(iVar3 + 4) = 0xffff;
  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)