L L4D2node

CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>::Sort

0x008a9f90 · 192 bytes · __thiscall

_ZN10CUtlVectorIN20CDirectorItemManager15HealingItemInfoE10CUtlMemoryIS1_iEE4SortEPFiPKS1_S6_E

Decompiled

undefined (2 params)

/* CUtlVector<CDirectorItemManager::HealingItemInfo,
   CUtlMemory<CDirectorItemManager::HealingItemInfo, int> >::Sort(int
   (*)(CDirectorItemManager::HealingItemInfo const*, CDirectorItemManager::HealingItemInfo const*))
    */

void __thiscall
CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>
::Sort(CUtlVector<CDirectorItemManager::HealingItemInfo,CUtlMemory<CDirectorItemManager::HealingItemInfo,int>>
       *this,_func_int_HealingItemInfo_ptr_HealingItemInfo_ptr *param_1)

{
  int iVar1;
  undefined4 uVar2;
  size_t __nmemb;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  int local_24;
  
  __nmemb = *(size_t *)(this + 0xc);
  if (1 < (int)__nmemb) {
    if (*(void **)this == (void *)0x0) {
      local_24 = __nmemb - 1;
      do {
        if (0 < local_24) {
          iVar5 = 1;
          do {
            while( true ) {
              iVar1 = iVar5 * 8;
              iVar4 = (*param_1)((HealingItemInfo *)(*(int *)this + iVar1 + -8),
                                 (HealingItemInfo *)(*(int *)this + iVar1));
              if (-1 < iVar4) break;
              iVar5 = iVar5 + 1;
              puVar6 = (undefined4 *)(iVar1 + *(int *)this);
              puVar7 = (undefined4 *)(iVar1 + -8 + *(int *)this);
              uVar3 = *puVar7;
              uVar2 = puVar7[1];
              *puVar7 = *puVar6;
              puVar7[1] = puVar6[1];
              *puVar6 = uVar3;
              puVar6[1] = uVar2;
              if (local_24 < iVar5) goto LAB_008aa048;
            }
            iVar5 = iVar5 + 1;
          } while (iVar5 <= local_24);
        }
LAB_008aa048:
        local_24 = local_24 + -1;
        if (local_24 == -1) {
          return;
        }
      } while( true );
    }
    qsort(*(void **)this,__nmemb,8,(__compar_fn_t)param_1);
  }
  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)