L L4D2node

CDirectorItemManager::GetCountOfProspectiveScavengeItem

0x008a5e30 · 247 bytes · __thiscall

_ZN20CDirectorItemManager33GetCountOfProspectiveScavengeItemE10CSWeaponID

Decompiled

undefined (2 params)

/* CDirectorItemManager::GetCountOfProspectiveScavengeItem(CSWeaponID) */

int __thiscall
CDirectorItemManager::GetCountOfProspectiveScavengeItem(CDirectorItemManager *this,int param_2)

{
  uint uVar1;
  byte bVar2;
  int *piVar3;
  int iVar4;
  int *piVar5;
  undefined *puVar6;
  int iVar7;
  
  iVar7 = 0;
  for (bVar2 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char,CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char>,unsigned_char>>
               ::FirstInorder((CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char,CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char>,unsigned_char>>
                               *)(this + 0x444)); bVar2 != 0xff;
      bVar2 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char,CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char>,unsigned_char>>
              ::NextInorder((CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char,CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,scavenge_cache_entry_t,unsigned_char>::Node_t,unsigned_char>,unsigned_char>>
                             *)(this + 0x444),bVar2)) {
    uVar1 = *(uint *)((uint)bVar2 * 0x10 + *(int *)(this + 0x448) + 4);
    if ((((uVar1 != 0xffffffff) &&
         (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
       (piVar5 = *(int **)(puVar6 + 4), piVar5 != (int *)0x0)) {
      piVar3 = (int *)__dynamic_cast(piVar5,&CBaseEntity::typeinfo,&CWeaponSpawn::typeinfo,0);
      if (piVar3 == (int *)0x0) {
        piVar5 = (int *)(**(code **)(*piVar5 + 0x188))(piVar5);
        if (piVar5 != (int *)0x0) {
          iVar4 = (**(code **)(*piVar5 + 0x638))(piVar5);
          iVar7 = iVar7 + (uint)(param_2 == iVar4);
        }
      }
      else {
        iVar4 = (**(code **)(*piVar3 + 0x3cc))(piVar3);
        iVar7 = iVar7 + (uint)(iVar4 == param_2);
      }
    }
  }
  return iVar7;
}

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)