L L4D2node

CDirectorItemManager::WriteScavengeItemsToLog

0x008a70a0 · 519 bytes · __thiscall

_ZN20CDirectorItemManager23WriteScavengeItemsToLogEPvPKcP20EntityPopulationInfoI7CHandleI11CBaseEntityEEff

Decompiled

undefined (6 params)

/* CDirectorItemManager::WriteScavengeItemsToLog(void*, char const*,
   EntityPopulationInfo<CHandle<CBaseEntity> >*, float, float) */

void __thiscall
CDirectorItemManager::WriteScavengeItemsToLog
          (CDirectorItemManager *this,void *param_1,char *param_2,EntityPopulationInfo *param_3,
          float param_4,float param_5)

{
  uint uVar1;
  int iVar2;
  undefined *puVar3;
  EntityLocationInfo *pEVar4;
  int iVar5;
  CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int> *local_54;
  CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int> *local_50;
  EntityLocationInfo *local_48;
  int *local_44;
  undefined4 local_40;
  undefined4 local_3c;
  int local_38;
  int *local_34;
  int *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  int *local_20;
  
  local_44 = (int *)0x0;
  local_40 = 0;
  local_3c = 0;
  local_38 = 0;
  local_34 = (int *)0x0;
  local_30 = (int *)0x0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = (int *)0x0;
  if (*(int *)(param_3 + 0x28) < 1) {
    iVar5 = 0;
  }
  else {
    iVar5 = 0;
    do {
      pEVar4 = (EntityLocationInfo *)(iVar5 * 0x20 + *(int *)(param_3 + 0x1c));
      uVar1 = *(uint *)(pEVar4 + 0x1c);
      if ((((uVar1 == 0xffffffff) ||
           (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
          (*(uint *)(puVar3 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar3 + 4) == 0)) {
        if (local_24 < 1) {
LAB_008a7170:
          local_48 = pEVar4;
                    /* try { // try from 008a7184 to 008a728c has its CatchHandler @ 008a72cd */
          CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>*,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>>
          ::InsertBefore((CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>*,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>>
                          *)&local_30,local_24,&local_48);
        }
        else if (pEVar4 != (EntityLocationInfo *)*local_30) {
          iVar2 = 0;
          do {
            iVar2 = iVar2 + 1;
            if (iVar2 == local_24) goto LAB_008a7170;
          } while (pEVar4 != (EntityLocationInfo *)local_30[iVar2]);
          if (iVar2 < 0) goto LAB_008a7170;
        }
      }
      else if (local_38 < 1) {
LAB_008a7274:
        local_48 = pEVar4;
        CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>*,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>>
        ::InsertBefore((CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>*,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>>
                        *)&local_44,local_38,&local_48);
      }
      else if (pEVar4 != (EntityLocationInfo *)*local_44) {
        iVar2 = 0;
        do {
          iVar2 = iVar2 + 1;
          if (iVar2 == local_38) goto LAB_008a7274;
        } while (pEVar4 != (EntityLocationInfo *)local_44[iVar2]);
        if (iVar2 < 0) goto LAB_008a7274;
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 < *(int *)(param_3 + 0x28));
    iVar5 = local_24 + local_38;
  }
  local_50 = (CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int> *)&local_44;
  local_54 = (CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int> *)&local_30;
  (**(code **)(*filesystem + 100))
            (filesystem,param_1,"%-20s: %3d out of %3d, desired %3d based on density %3.3f\n",
             param_2,local_38,iVar5,(int)(param_4 * param_5),(double)param_4);
  local_24 = 0;
  CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>::Purge(local_54);
  local_20 = local_30;
  CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>::Purge(local_54);
  local_38 = 0;
  CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>::Purge(local_50);
  local_34 = local_44;
  CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>*,int>::Purge(local_50);
  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)