L L4D2node

CUtlRBTree<MatchingProp_t,unsigned_short,bool(*)(MatchingProp_t_const&,MatchingProp_t_const&),CUtlMemory<UtlRBTreeNode_t<MatchingProp_t,unsigned_short>,unsigned_short>>::Insert

0x001540a0 · 684 bytes · __thiscall

_ZN10CUtlRBTreeI14MatchingProp_ttPFbRKS0_S2_E10CUtlMemoryI15UtlRBTreeNode_tIS0_tEtEE6InsertES2_

Decompiled

undefined (2 params)

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

uint __thiscall
CUtlRBTree<MatchingProp_t,unsigned_short,bool(*)(MatchingProp_t_const&,MatchingProp_t_const&),CUtlMemory<UtlRBTreeNode_t<MatchingProp_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<MatchingProp_t,unsigned_short,bool(*)(MatchingProp_t_const&,MatchingProp_t_const&),CUtlMemory<UtlRBTreeNode_t<MatchingProp_t,unsigned_short>,unsigned_short>>
         *this,MatchingProp_t *param_1)

{
  undefined4 uVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  undefined2 *puVar5;
  ushort uVar6;
  uint uVar8;
  undefined2 uVar9;
  int iVar10;
  uint uVar11;
  uint local_24;
  int local_20;
  uint uVar7;
  
  uVar8 = (uint)*(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    bVar2 = false;
  }
  else {
    while( true ) {
      iVar10 = uVar8 * 0x10;
      cVar3 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar10 + 8);
      if (cVar3 == '\0') {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00340f22 = 0xffff;
          DAT_00340f24 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        uVar6 = *(ushort *)(*(int *)(this + 4) + 2 + iVar10);
        bVar2 = false;
      }
      else {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00340f22 = 0xffff;
          DAT_00340f24 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        uVar6 = *(ushort *)(*(int *)(this + 4) + iVar10);
        bVar2 = true;
      }
      if (uVar6 == 0xffff) break;
      uVar8 = (uint)uVar6;
    }
  }
  local_24._0_2_ = *(ushort *)(this + 0x14);
  uVar11 = (uint)(ushort)local_24;
  if ((ushort)local_24 != 0xffff) {
    iVar10 = *(int *)(this + 4);
    local_20 = (uint)(ushort)local_24 * 0x10;
    puVar5 = (undefined2 *)(local_20 + iVar10);
    *(undefined2 *)(this + 0x14) = puVar5[1];
    goto LAB_00154147;
  }
  iVar10 = *(int *)(this + 8);
  if ((int)(uint)*(ushort *)(this + 0x16) < iVar10) {
    uVar7 = *(ushort *)(this + 0x16) + 1;
    uVar6 = (ushort)uVar7;
    uVar7 = uVar7 & 0xffff;
    if (iVar10 <= (int)uVar7) {
      uVar6 = 0xffff;
    }
    local_24 = 0xffff;
    if ((int)uVar7 < iVar10) {
      local_24 = uVar7;
    }
    if ((int)local_24 < iVar10) goto LAB_001542b1;
LAB_001542f7:
    CUtlMemory<UtlRBTreeNode_t<MatchingProp_t,unsigned_short>,unsigned_short>::Grow
              ((CUtlMemory<UtlRBTreeNode_t<MatchingProp_t,unsigned_short>,unsigned_short> *)
               (this + 4),1);
    iVar10 = *(int *)(this + 8);
    if ((int)(uint)*(ushort *)(this + 0x16) < iVar10) {
      uVar6 = *(ushort *)(this + 0x16) + 1;
      local_24 = (uint)uVar6;
      if ((int)local_24 < iVar10) {
        uVar11 = (uint)uVar6;
        local_20 = local_24 << 4;
      }
      else {
        local_20 = 0xffff0;
        local_24 = 0xffff;
      }
    }
    else {
      local_20 = 0xffff0;
      if (0 < iVar10) {
        local_20 = 0;
        uVar11 = 0;
      }
      local_24 = 0xffff;
      if (0 < iVar10) {
        local_24 = 0;
      }
    }
    if (iVar10 <= (int)local_24) {
      Error("CUtlRBTree overflow!\n");
    }
  }
  else {
    local_24 = 0xffff;
    if (0 < iVar10) {
      local_24 = 0;
    }
    uVar6 = (0 < iVar10) - 1;
    if (iVar10 <= (int)local_24) goto LAB_001542f7;
LAB_001542b1:
    uVar11 = (uint)uVar6;
    local_20 = uVar11 << 4;
  }
  iVar10 = *(int *)(this + 4);
  *(short *)(this + 0x16) = (short)uVar11;
  puVar5 = (undefined2 *)(iVar10 + local_20);
LAB_00154147:
  *(int *)(this + 0x18) = iVar10;
  puVar5[1] = 0xffff;
  puVar5[2] = (short)uVar8;
  *puVar5 = 0xffff;
  puVar5[3] = 0;
  uVar9 = (undefined2)uVar11;
  if ((short)uVar8 == -1) {
    *(undefined2 *)(this + 0x10) = uVar9;
  }
  else {
    puVar5 = (undefined2 *)(uVar8 * 0x10 + *(int *)(this + 4));
    if (bVar2) {
      *puVar5 = uVar9;
    }
    else {
      puVar5[1] = uVar9;
    }
  }
  InsertRebalance(this,(ushort)local_24);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  local_20 = local_20 + *(int *)(this + 4);
  if (local_20 != -8) {
    uVar1 = *(undefined4 *)param_1;
    *(undefined4 *)(local_20 + 0xc) = *(undefined4 *)(param_1 + 4);
    *(undefined4 *)(local_20 + 8) = uVar1;
  }
  return uVar11;
}

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)