L L4D2node

CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>::Insert

0x00404020 · 546 bytes · __thiscall

_ZN10CUtlRBTreeIN19CCombatCharVisCache15VisCacheEntry_tEtNS0_18CVisCacheEntryLessE10CUtlMemoryI15UtlRBTreeNode_tIS1_tEtEE6InsertERKS1_

Decompiled

undefined (2 params)

/* CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t, unsigned short,
   CCombatCharVisCache::CVisCacheEntryLess,
   CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t, unsigned short>, unsigned short>
   >::Insert(CCombatCharVisCache::VisCacheEntry_t const&) */

uint __thiscall
CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CCombatCharVisCache::VisCacheEntry_t,unsigned_short,CCombatCharVisCache::CVisCacheEntryLess,CUtlMemory<UtlRBTreeNode_t<CCombatCharVisCache::VisCacheEntry_t,unsigned_short>,unsigned_short>>
         *this,VisCacheEntry_t *param_1)

{
  ushort uVar1;
  bool bVar2;
  int iVar3;
  uint uVar4;
  undefined2 *puVar5;
  int iVar6;
  ushort uVar7;
  ushort *puVar8;
  uint local_28;
  int local_24;
  
  uVar1 = *(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    uVar4 = NewNode(this);
    local_28 = uVar4 & 0xffff;
    local_24 = local_28 * 0x18;
    puVar5 = (undefined2 *)(*(int *)(this + 4) + local_24);
    puVar5[2] = 0xffff;
    puVar5[1] = 0xffff;
    *puVar5 = 0xffff;
    puVar5[3] = 0;
  }
  else {
    do {
      uVar7 = uVar1;
      iVar6 = (uint)uVar7 * 0x18;
      puVar8 = (ushort *)(*(int *)(this + 4) + iVar6);
      iVar3 = memcmp(param_1,puVar8 + 4,8);
      if (iVar3 < 0) {
        if (Links(unsigned_short)::s_Sentinel == '\0') {
          iVar3 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar3 != 0) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f13992 = 0xffff;
            DAT_00f13994 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          puVar8 = (ushort *)(*(int *)(this + 4) + iVar6);
        }
        uVar1 = *puVar8;
        bVar2 = true;
      }
      else {
        if (Links(unsigned_short)::s_Sentinel == '\0') {
          iVar3 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar3 != 0) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f13992 = 0xffff;
            DAT_00f13994 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          puVar8 = (ushort *)(*(int *)(this + 4) + iVar6);
        }
        uVar1 = puVar8[1];
        bVar2 = false;
      }
    } while (uVar1 != 0xffff);
    uVar4 = NewNode(this);
    local_28 = uVar4 & 0xffff;
    local_24 = local_28 * 0x18;
    puVar5 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar5[1] = 0xffff;
    *puVar5 = 0xffff;
    puVar5[2] = uVar7;
    puVar5[3] = 0;
    if (uVar7 != 0xffff) {
      if (bVar2) {
        *(short *)(*(int *)(this + 4) + iVar6) = (short)uVar4;
      }
      else {
        *(short *)(*(int *)(this + 4) + 2 + iVar6) = (short)uVar4;
      }
      goto LAB_004040ff;
    }
  }
  *(short *)(this + 0x10) = (short)uVar4;
LAB_004040ff:
  InsertRebalance(this,(ushort)local_28);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  local_24 = local_24 + *(int *)(this + 4);
  if (local_24 != -8) {
    *(undefined4 *)(local_24 + 8) = *(undefined4 *)param_1;
    *(undefined4 *)(local_24 + 0xc) = *(undefined4 *)(param_1 + 4);
    *(undefined4 *)(local_24 + 0x10) = *(undefined4 *)(param_1 + 8);
    *(VisCacheEntry_t *)(local_24 + 0x14) = param_1[0xc];
    *(VisCacheEntry_t *)(local_24 + 0x15) = param_1[0xd];
  }
  return uVar4;
}

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)