L L4D2node

CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>::Grow

0x005ab4a0 · 211 bytes · __thiscall

_ZN10CUtlMemoryI15UtlRBTreeNode_tIN14AI_CriteriaSet11CritEntry_tEsEsE4GrowEi

Decompiled

undefined (2 params)

/* CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t, short>, short>::Grow(int) */

void __thiscall
CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short>::Grow
          (CUtlMemory<UtlRBTreeNode_t<AI_CriteriaSet::CritEntry_t,short>,short> *this,int param_1)

{
  int iVar1;
  short sVar2;
  int iVar3;
  void *pvVar4;
  uint uVar5;
  uint uVar6;
  
  iVar1 = *(int *)(this + 8);
  if (iVar1 < 0) {
    return;
  }
  iVar3 = *(int *)(this + 4);
  uVar5 = param_1 + iVar3;
  if (iVar1 == 0) {
    if (iVar3 == 0) {
      iVar3 = 1;
    }
    for (; iVar3 < (int)uVar5; iVar3 = iVar3 * 2) {
    }
  }
  else {
    iVar3 = ((int)(uVar5 - 1) / iVar1 + 1) * iVar1;
  }
  sVar2 = (short)iVar3;
  if ((int)sVar2 < (int)uVar5) {
    if ((sVar2 == 0) && (0x7fffffff < uVar5)) {
      iVar3 = iVar3 + -1;
    }
    else {
      uVar6 = (uint)(short)uVar5;
      if (uVar6 != uVar5) {
        return;
      }
      if ((int)sVar2 < (int)uVar5) {
        do {
          iVar3 = (int)(iVar3 + uVar6) / 2;
        } while ((int)(short)iVar3 < (int)uVar6);
        pvVar4 = *(void **)this;
        *(int *)(this + 4) = iVar3;
        goto joined_r0x005ab4f5;
      }
    }
  }
  pvVar4 = *(void **)this;
  *(int *)(this + 4) = iVar3;
joined_r0x005ab4f5:
  if (pvVar4 != (void *)0x0) {
    pvVar4 = realloc(pvVar4,iVar3 * 0x50);
    *(void **)this = pvVar4;
    return;
  }
  pvVar4 = malloc(iVar3 * 0x50);
  *(void **)this = pvVar4;
  return;
}

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)