L L4D2node

CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>::Insert

0x005acd10 · 542 bytes · __thiscall

_ZN10CUtlRBTreeIN14AI_CriteriaSet11CritEntry_tEsPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_sEsEE6InsertES3_

Decompiled

undefined (2 params)

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

short __thiscall
CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>
::Insert(CUtlRBTree<AI_CriteriaSet::CritEntry_t,short,bool(*)(AI_CriteriaSet::CritEntry_t_const&,AI_CriteriaSet::CritEntry_t_const&),CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>>
         *this,CritEntry_t *param_1)

{
  short sVar1;
  undefined2 uVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  undefined2 *puVar6;
  int iVar7;
  short sVar8;
  int local_24;
  short local_1e;
  
  sVar1 = *(short *)(this + 0x10);
  if (*(short *)(this + 0x10) == -1) {
    local_1e = NewNode(this);
    local_24 = local_1e * 0x50;
    puVar6 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar6[2] = 0xffff;
    puVar6[1] = 0xffff;
    *puVar6 = 0xffff;
    puVar6[3] = 0;
  }
  else {
    do {
      sVar8 = sVar1;
      iVar7 = sVar8 * 0x50;
      cVar4 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar7 + 8);
      if (cVar4 == '\0') {
        if ((Links(short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(short)::s_Sentinel), iVar5 != 0)) {
          Links(short)::s_Sentinel = 0xffff;
          DAT_00f21a9a = 0xffff;
          DAT_00f21a9c = 0xffff;
          __cxa_guard_release(&Links(short)::s_Sentinel);
        }
        bVar3 = false;
        sVar1 = *(short *)(*(int *)(this + 4) + 2 + iVar7);
      }
      else {
        if ((Links(short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(short)::s_Sentinel), iVar5 != 0)) {
          Links(short)::s_Sentinel = 0xffff;
          DAT_00f21a9a = 0xffff;
          DAT_00f21a9c = 0xffff;
          __cxa_guard_release(&Links(short)::s_Sentinel);
        }
        bVar3 = true;
        sVar1 = *(short *)(*(int *)(this + 4) + iVar7);
      }
    } while (sVar1 != -1);
    local_1e = NewNode(this);
    local_24 = local_1e * 0x50;
    puVar6 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar6[1] = 0xffff;
    *puVar6 = 0xffff;
    puVar6[2] = sVar8;
    puVar6[3] = 0;
    if (sVar8 != -1) {
      if (bVar3) {
        *(short *)(*(int *)(this + 4) + iVar7) = local_1e;
      }
      else {
        *(short *)(*(int *)(this + 4) + 2 + iVar7) = local_1e;
      }
      goto LAB_005acded;
    }
  }
  *(short *)(this + 0x10) = local_1e;
LAB_005acded:
  InsertRebalance(this,local_1e);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  local_24 = local_24 + *(int *)(this + 4);
  if (local_24 != -8) {
    *(undefined2 *)(local_24 + 8) = 0xffff;
    uVar2 = *(undefined2 *)param_1;
    *(char *)(local_24 + 10) = '\0';
    *(undefined2 *)(local_24 + 8) = uVar2;
    *(undefined4 *)(local_24 + 0x4c) = *(undefined4 *)(param_1 + 0x44);
    V_strncpy((char *)(local_24 + 10),(char *)(param_1 + 2),0x40);
  }
  return local_1e;
}

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)