L L4D2node

CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>::Insert

0x007d2290 · 478 bytes · __thiscall

_ZN10CUtlRBTreeI7CHandleI11CBaseEntityEtPFbRKS2_S4_E10CUtlMemoryI15UtlRBTreeNode_tIS2_tEtEE6InsertES4_

Decompiled

undefined (2 params)

/* CUtlRBTree<CHandle<CBaseEntity>, unsigned short, bool (*)(CHandle<CBaseEntity> const&,
   CHandle<CBaseEntity> const&), CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>, unsigned short>,
   unsigned short> >::Insert(CHandle<CBaseEntity> const&) */

uint __thiscall
CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
         *this,CHandle *param_1)

{
  int iVar1;
  ushort uVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  uint uVar6;
  undefined2 *puVar7;
  uint uVar8;
  int local_24;
  ushort local_1e;
  
  uVar2 = *(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    uVar6 = NewNode(this);
    uVar8 = uVar6 & 0xffff;
    local_24 = uVar8 * 0xc;
    puVar7 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar7[2] = 0xffff;
    puVar7[1] = 0xffff;
    *puVar7 = 0xffff;
    puVar7[3] = 0;
  }
  else {
    do {
      local_1e = uVar2;
      iVar1 = (uint)local_1e * 0xc;
      cVar4 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar1 + 8);
      if (cVar4 == '\0') {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f4ee6a = 0xffff;
          DAT_00f4ee6c = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar3 = false;
        uVar2 = *(ushort *)(*(int *)(this + 4) + 2 + iVar1);
      }
      else {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f4ee6a = 0xffff;
          DAT_00f4ee6c = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar3 = true;
        uVar2 = *(ushort *)(*(int *)(this + 4) + (uint)local_1e * 0xc);
      }
    } while (uVar2 != 0xffff);
    uVar6 = NewNode(this);
    uVar8 = uVar6 & 0xffff;
    local_24 = uVar8 * 0xc;
    puVar7 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar7[2] = local_1e;
    puVar7[1] = 0xffff;
    *puVar7 = 0xffff;
    puVar7[3] = 0;
    if (local_1e != 0xffff) {
      if (bVar3) {
        *(short *)(*(int *)(this + 4) + iVar1) = (short)uVar6;
      }
      else {
        *(short *)(*(int *)(this + 4) + 2 + iVar1) = (short)uVar6;
      }
      goto LAB_007d2368;
    }
  }
  *(short *)(this + 0x10) = (short)uVar6;
LAB_007d2368:
  InsertRebalance(this,(ushort)uVar8);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  if (local_24 + *(int *)(this + 4) != -8) {
    *(undefined4 *)(local_24 + *(int *)(this + 4) + 8) = *(undefined4 *)param_1;
  }
  return uVar6;
}

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)