L L4D2node

CUtlRBTree<CUtlString,int,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,int>,int>>::Insert

0x00190850 · 449 bytes · __thiscall

_ZN10CUtlRBTreeI10CUtlStringiPFbRKS0_S2_E10CUtlMemoryI15UtlRBTreeNode_tIS0_iEiEE6InsertES2_

Decompiled

undefined (2 params)

/* CUtlRBTree<CUtlString, int, bool (*)(CUtlString const&, CUtlString const&),
   CUtlMemory<UtlRBTreeNode_t<CUtlString, int>, int> >::Insert(CUtlString const&) */

int __thiscall
CUtlRBTree<CUtlString,int,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,int>,int>>
::Insert(CUtlRBTree<CUtlString,int,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,int>,int>>
         *this,CUtlString *param_1)

{
  bool bVar1;
  char cVar2;
  CUtlString *this_00;
  int iVar3;
  undefined4 *puVar4;
  int iVar5;
  int iVar6;
  int local_24;
  int local_20;
  
  iVar3 = *(int *)(this + 0x10);
  if (*(int *)(this + 0x10) == -1) {
    local_20 = NewNode(this);
    local_24 = local_20 * 0x20;
    puVar4 = (undefined4 *)(local_24 + *(int *)(this + 4));
    puVar4[2] = 0xffffffff;
    puVar4[1] = 0xffffffff;
    *puVar4 = 0xffffffff;
    puVar4[3] = 0;
  }
  else {
    do {
      iVar6 = iVar3;
      iVar5 = iVar6 * 0x20;
      cVar2 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar5 + 0x10);
      if (cVar2 == '\0') {
        if ((Links(int)::s_Sentinel == '\0') &&
           (iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar3 != 0)) {
          Links(int)::s_Sentinel = 0xffffffff;
          DAT_003412d0 = 0xffffffff;
          DAT_003412d4 = 0xffffffff;
          __cxa_guard_release(&Links(int)::s_Sentinel);
        }
        bVar1 = false;
        iVar3 = *(int *)(*(int *)(this + 4) + 4 + iVar5);
      }
      else {
        if ((Links(int)::s_Sentinel == '\0') &&
           (iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar3 != 0)) {
          Links(int)::s_Sentinel = 0xffffffff;
          DAT_003412d0 = 0xffffffff;
          DAT_003412d4 = 0xffffffff;
          __cxa_guard_release(&Links(int)::s_Sentinel);
        }
        bVar1 = true;
        iVar3 = *(int *)(*(int *)(this + 4) + iVar5);
      }
    } while (iVar3 != -1);
    local_20 = NewNode(this);
    local_24 = local_20 * 0x20;
    puVar4 = (undefined4 *)(local_24 + *(int *)(this + 4));
    puVar4[2] = iVar6;
    puVar4[1] = 0xffffffff;
    *puVar4 = 0xffffffff;
    puVar4[3] = 0;
    if (iVar6 != -1) {
      if (bVar1) {
        *(int *)(*(int *)(this + 4) + iVar5) = local_20;
      }
      else {
        *(int *)(*(int *)(this + 4) + 4 + iVar5) = local_20;
      }
      goto LAB_00190913;
    }
  }
  *(int *)(this + 0x10) = local_20;
LAB_00190913:
  InsertRebalance(this,local_20);
  *(int *)(this + 0x14) = *(int *)(this + 0x14) + 1;
  this_00 = (CUtlString *)(local_24 + *(int *)(this + 4) + 0x10);
  if (this_00 != (CUtlString *)0x0) {
    CUtlString::CUtlString(this_00,param_1);
  }
  return local_20;
}

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)