L L4D2node

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

0x0012c8d0 · 454 bytes · __thiscall

_ZN10CUtlRBTreeIP6ConVariPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_iEiEE6InsertES3_

Decompiled

undefined (2 params)

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

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

{
  int iVar1;
  bool bVar2;
  char cVar3;
  int iVar4;
  undefined4 *puVar5;
  int iVar6;
  int local_24;
  
  iVar4 = *(int *)(this + 0x10);
  if (*(int *)(this + 0x10) == -1) {
    iVar4 = NewNode(this);
    local_24 = iVar4 * 0x14;
    puVar5 = (undefined4 *)(local_24 + *(int *)(this + 4));
    puVar5[2] = 0xffffffff;
    puVar5[1] = 0xffffffff;
    *puVar5 = 0xffffffff;
    puVar5[3] = 0;
  }
  else {
    do {
      iVar6 = iVar4;
      iVar1 = iVar6 * 0x14;
      cVar3 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar1 + 0x10);
      if (cVar3 == '\0') {
        if ((Links(int)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar4 != 0)) {
          Links(int)::s_Sentinel = 0xffffffff;
          DAT_00340da8 = 0xffffffff;
          DAT_00340dac = 0xffffffff;
          __cxa_guard_release(&Links(int)::s_Sentinel);
        }
        bVar2 = false;
        iVar4 = *(int *)(*(int *)(this + 4) + 4 + iVar1);
      }
      else {
        if ((Links(int)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar4 != 0)) {
          Links(int)::s_Sentinel = 0xffffffff;
          DAT_00340da8 = 0xffffffff;
          DAT_00340dac = 0xffffffff;
          __cxa_guard_release(&Links(int)::s_Sentinel);
        }
        iVar4 = *(int *)(*(int *)(this + 4) + iVar6 * 0x14);
        bVar2 = true;
      }
    } while (iVar4 != -1);
    iVar4 = NewNode(this);
    local_24 = iVar4 * 0x14;
    puVar5 = (undefined4 *)(local_24 + *(int *)(this + 4));
    puVar5[2] = iVar6;
    puVar5[1] = 0xffffffff;
    *puVar5 = 0xffffffff;
    puVar5[3] = 0;
    if (iVar6 != -1) {
      if (bVar2) {
        *(int *)(*(int *)(this + 4) + iVar1) = iVar4;
      }
      else {
        *(int *)(*(int *)(this + 4) + 4 + iVar1) = iVar4;
      }
      goto LAB_0012c99d;
    }
  }
  *(int *)(this + 0x10) = iVar4;
LAB_0012c99d:
  InsertRebalance(this,iVar4);
  *(int *)(this + 0x14) = *(int *)(this + 0x14) + 1;
  if (local_24 + *(int *)(this + 4) != -0x10) {
    *(ConVar **)(local_24 + *(int *)(this + 4) + 0x10) = *param_1;
  }
  return iVar4;
}

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)