L L4D2node

CDirectorItemManager::LogScavengeItems

0x008a8110 · 5830 bytes · __thiscall

_ZN20CDirectorItemManager16LogScavengeItemsEPKc

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CDirectorItemManager::LogScavengeItems(char const*) */

void __thiscall CDirectorItemManager::LogScavengeItems(CDirectorItemManager *this,char *param_1)

{
  float fVar1;
  code *pcVar2;
  code *pcVar3;
  uint uVar4;
  undefined4 uVar5;
  char cVar6;
  void *pvVar7;
  CBaseEntity *this_00;
  int iVar8;
  CMapInfo *this_01;
  int *piVar9;
  undefined *puVar10;
  int *piVar11;
  undefined1 *puVar12;
  char *pcVar13;
  int iVar14;
  undefined1 *puVar15;
  int *piVar16;
  int iVar17;
  int iVar18;
  longdouble lVar19;
  int iStackY_144;
  int local_140;
  int aiStack_124 [17];
  int local_e0;
  int local_d8;
  double local_d4;
  double local_cc;
  double local_c4;
  double local_bc;
  undefined1 *local_b0 [2];
  ConVarRef local_a8 [8];
  ConVarRef local_a0 [8];
  ConVarRef local_98 [8];
  int local_90;
  undefined4 local_8c;
  undefined4 local_88;
  int local_84;
  int local_80;
  int local_7c;
  undefined4 local_78;
  undefined4 local_74;
  int local_70;
  int local_6c;
  int local_68 [22];
  
  piVar16 = (int *)&stack0xfffffec4;
  ConVarRef::ConVarRef(local_a8,"sv_logsdir");
  pvVar7 = (void *)(**(code **)(filesystem[1] + 8))();
  if (pvVar7 == (void *)0x0) {
    Warning();
  }
  else {
    (**(code **)(_g_pVCR + 0x5c))();
    (**(code **)(*filesystem + 100))();
    (**(code **)(*filesystem + 100))();
    (**(code **)(*filesystem + 100))();
    ConVarRef::ConVarRef(local_a0,"mp_gamemode");
    ConVarRef::ConVarRef(local_98,"z_difficulty");
    (**(code **)(*filesystem + 100))();
    (**(code **)(*filesystem + 100))();
    cVar6 = CTerrorGameRules::IsVersusMode();
    if (cVar6 != '\0') {
      if (*(char *)(g_pGameRules + 0x491) != '\0') {
        (**(code **)(*filesystem + 100))();
      }
      cVar6 = CDirector::AreTeamsFlipped(TheDirector);
      if (cVar6 != '\0') {
        (**(code **)(*filesystem + 100))();
      }
    }
    local_bc._0_4_ = 2;
    iVar8 = gpGlobals;
    do {
      if (0 < *(int *)(iVar8 + 0x14)) {
        iVar17 = 1;
        do {
          this_00 = (CBaseEntity *)UTIL_PlayerByIndex(iVar17);
          if ((((((this_00 != (CBaseEntity *)0x0) && (*(int *)(this_00 + 0x30) != 0)) &&
                (*(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
               ((cVar6 = (**(code **)(*(int *)this_00 + 0x16c))(), cVar6 != '\0' &&
                (*(int *)(this_00 + 0x1f6c) != 2)))) &&
              (cVar6 = (**(code **)(*(int *)this_00 + 0x778))(), cVar6 == '\0')) &&
             (iVar8 = CBaseEntity::GetTeamNumber(this_00), local_bc._0_4_ == iVar8)) {
            pcVar2 = *(code **)(*filesystem + 100);
            (**(code **)(*(int *)this_00 + 0xb8))();
            (*pcVar2)();
          }
          iVar17 = iVar17 + 1;
          iVar8 = gpGlobals;
        } while (iVar17 <= *(int *)(gpGlobals + 0x14));
      }
      local_bc._0_4_ = local_bc._0_4_ + 1;
    } while (local_bc._0_4_ != 4);
    lVar19 = (longdouble)CalculateScavengeWalkableArea();
    fVar1 = (float)lVar19;
    (**(code **)(*filesystem + 100))();
    this_01 = (CMapInfo *)GetMapInfo();
    (**(code **)(*filesystem + 100))();
    lVar19 = (longdouble)CMapInfo::GetPainPillDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Pain Pills",(EntityPopulationInfo *)(this + 0x2c),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetMolotovDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Molotov",(EntityPopulationInfo *)(this + 0x60),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetAmmoDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Ammo",(EntityPopulationInfo *)(this + 0x94),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetPipeBombDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Pipe Bombs",(EntityPopulationInfo *)(this + 200),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetPistolDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Pistols",(EntityPopulationInfo *)(this + 0xfc),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetMagnumDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Magnums",(EntityPopulationInfo *)(this + 0x130),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetGasCanDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Gas Cans",(EntityPopulationInfo *)(this + 0x164),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetPropaneTankDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Propane Tanks",(EntityPopulationInfo *)(this + 0x198),(float)lVar19,
               fVar1);
    lVar19 = (longdouble)CMapInfo::GetOxygenTankDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Oxygen Tanks",(EntityPopulationInfo *)(this + 0x1cc),(float)lVar19,fVar1
              );
    lVar19 = (longdouble)CMapInfo::GetMeleeWeaponDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Melee Weapons",(EntityPopulationInfo *)(this + 0x200),(float)lVar19,
               fVar1);
    lVar19 = (longdouble)CMapInfo::GetAdrenalineDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Adrenaline",(EntityPopulationInfo *)(this + 0x234),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetDefibrillatorDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Defibs",(EntityPopulationInfo *)(this + 0x268),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetVomitJarDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Vomit Jars",(EntityPopulationInfo *)(this + 0x29c),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetUpgradePackDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Upgrades",(EntityPopulationInfo *)(this + 0x2d0),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetUpgradePackDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Upgrade Packs",(EntityPopulationInfo *)(this + 0x304),(float)lVar19,
               fVar1);
    lVar19 = (longdouble)CMapInfo::GetSuperWeaponDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Chainsaws",(EntityPopulationInfo *)(this + 0x338),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetSuperWeaponDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Grenade Launchers",(EntityPopulationInfo *)(this + 0x36c),(float)lVar19,
               fVar1);
    lVar19 = (longdouble)CMapInfo::GetSuperWeaponDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"M60s",(EntityPopulationInfo *)(this + 0x3a0),(float)lVar19,fVar1);
    lVar19 = (longdouble)CMapInfo::GetConfigurableWeaponDensity(this_01);
    WriteScavengeItemsToLog
              (this,pvVar7,"Configurable Weapon",(EntityPopulationInfo *)(this + 0x3d4),
               (float)lVar19,fVar1);
    local_90 = 0;
    local_8c = 0;
    local_88 = 0;
    local_84 = 0;
    local_80 = 0;
                    /* try { // try from 008a8ab3 to 008a8db9 has its CatchHandler @ 008a9836 */
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x2c),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x60),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x94),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 200),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0xfc),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x130),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x164),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x198),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x1cc),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x200),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x234),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x268),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x29c),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x2d0),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x304),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x338),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x36c),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x3a0),(CUtlVector *)&local_90);
    AddSpawnedItemsToList(this,(EntityPopulationInfo *)(this + 0x3d4),(CUtlVector *)&local_90);
    CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int>>
    ::Sort((CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int>>
            *)&local_90,SortItemLocationInfoByFlowDistance);
    (**(code **)(*filesystem + 100))();
    if (0 < local_84) {
      iVar8 = 0;
      piVar11 = (int *)&stack0xfffffec4;
      do {
        iVar17 = 0;
        iVar18 = iVar8 * 0x20 + local_90;
        uVar4 = *(uint *)(iVar18 + 0x1c);
        if (((uVar4 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) {
          iVar17 = *(int *)(puVar10 + 4);
        }
        if ((*(byte *)(iVar17 + 0x14d) & 8) != 0) {
          *piVar11 = iVar17;
          piVar11[-1] = 0x8a8cd1;
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar11);
        }
        piVar11[6] = 0;
        piVar11[5] = 1;
        piVar11[4] = 0;
        piVar11[3] = 0x461c4000;
        piVar11[2] = 0;
        piVar11[1] = iVar17 + 0x2e0;
        *piVar11 = TheNavMesh;
        piVar11[-1] = 0x8a8d10;
        iVar17 = CNavMesh::GetNearestNavArea
                           ((CNavMesh *)*piVar11,(Vector *)piVar11[1],SUB41(piVar11[2],0),
                            (float)piVar11[3],SUB41(piVar11[4],0),SUB41(piVar11[5],0),
                            SUB41(piVar11[6],0));
        pcVar2 = *(code **)(*filesystem + 100);
        if (iVar17 == 0) {
          local_c4 = -1.0;
        }
        else {
          local_c4 = (double)*(float *)(iVar17 + 0x154);
        }
        uVar4 = *(uint *)(iVar18 + 0x1c);
        piVar9 = (int *)0x0;
        if (((uVar4 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) {
          piVar9 = *(int **)(puVar10 + 4);
        }
        iVar17 = *piVar9;
        piVar11[1] = (int)piVar9;
        *piVar11 = (int)local_b0;
        pcVar3 = *(code **)(iVar17 + 0x20);
        piVar11[-1] = 0x8a8d79;
        (*pcVar3)();
        piVar16 = piVar11 + -1;
        piVar11[1] = (int)"%-54s %-6.1f\n";
        *(double *)(piVar11 + 3) = local_c4;
        puVar12 = &DAT_00d539c2;
        if (local_b0[0] != (undefined1 *)0x0) {
          puVar12 = local_b0[0];
        }
        piVar11[2] = (int)puVar12;
        *piVar11 = (int)pvVar7;
        piVar11[-1] = (int)filesystem;
        piVar11[-2] = 0x8a8dba;
        (*pcVar2)();
        iVar8 = iVar8 + 1;
        piVar11 = piVar11 + -1;
      } while (iVar8 < local_84);
    }
    iVar8 = *filesystem;
    piVar16[2] = (int)"\nPrinting Finale items:\n";
    piVar16[1] = (int)pvVar7;
    *piVar16 = (int)filesystem;
                    /* try { // try from 008a8e7d to 008a9160 has its CatchHandler @ 008a9836 */
    pcVar2 = *(code **)(iVar8 + 100);
    piVar16[-1] = 0x8a8e80;
    (*pcVar2)();
    if (0 < *(int *)(this + 0x428)) {
      iVar8 = 0;
      do {
        while( true ) {
          iVar17 = *(int *)(*(int *)(this + 0x41c) + iVar8 * 4);
          uVar4 = *(uint *)(iVar17 + 0x1c);
          if (((uVar4 == 0xffffffff) ||
              (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)
              ) || ((*(uint *)(puVar10 + 8) != uVar4 >> 0xc ||
                    (iVar18 = *(int *)(puVar10 + 4), iVar18 == 0)))) break;
          if ((*(byte *)(iVar18 + 0x14d) & 8) != 0) {
            *piVar16 = iVar18;
            piVar16[-1] = 0x8a8efd;
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
          }
          piVar16[6] = 0;
          piVar16[5] = 1;
          piVar16[4] = 0;
          piVar16[3] = 0x461c4000;
          piVar16[2] = 0;
          piVar16[1] = iVar18 + 0x2e0;
          *piVar16 = TheNavMesh;
          piVar16[-1] = 0x8a8f3c;
          iVar18 = CNavMesh::GetNearestNavArea
                             ((CNavMesh *)*piVar16,(Vector *)piVar16[1],SUB41(piVar16[2],0),
                              (float)piVar16[3],SUB41(piVar16[4],0),SUB41(piVar16[5],0),
                              SUB41(piVar16[6],0));
          pcVar2 = *(code **)(*filesystem + 100);
          if (iVar18 == 0) {
            local_bc = -1.0;
          }
          else {
            local_bc = (double)*(float *)(iVar18 + 0x154);
          }
          iVar18 = 0;
          uVar4 = *(uint *)(iVar17 + 0x1c);
          if (((uVar4 != 0xffffffff) &&
              (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)
              ) && (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) {
            iVar18 = *(int *)(puVar10 + 4);
          }
          piVar16[1] = iVar18;
          *piVar16 = (int)this;
          piVar16[-1] = 0x8a8fa8;
          iVar17 = GetScavengeItemDebugName
                             ((CDirectorItemManager *)*piVar16,(CBaseEntity *)piVar16[1]);
          piVar16[3] = iVar17;
          piVar16[2] = (int)"%-16s %-6.1f\n";
          *(double *)(piVar16 + 4) = local_bc;
          piVar16[1] = (int)pvVar7;
          *piVar16 = (int)filesystem;
          piVar16[-1] = 0x8a8fd6;
          (*pcVar2)();
          iVar8 = iVar8 + 1;
          if (*(int *)(this + 0x428) <= iVar8) goto LAB_008a8fe8;
        }
        iVar8 = iVar8 + 1;
      } while (iVar8 < *(int *)(this + 0x428));
    }
LAB_008a8fe8:
    iVar8 = *filesystem;
    piVar16[2] = (int)"\nPrinting survivor items:\n";
    piVar16[1] = (int)pvVar7;
    *piVar16 = (int)filesystem;
    pcVar2 = *(code **)(iVar8 + 100);
    piVar16[-1] = 0x8a9007;
    (*pcVar2)();
    if (0 < *(int *)(gpGlobals + 0x14)) {
      iVar8 = 1;
      do {
        *piVar16 = iVar8;
        piVar16[-1] = 0x8a9039;
        piVar11 = (int *)UTIL_PlayerByIndex(*piVar16);
        if (((piVar11 != (int *)0x0) && (piVar11[0xc] != 0)) &&
           (piVar11[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0)) {
          *piVar16 = (int)piVar11;
          piVar16[-1] = 0x8a905d;
          iVar17 = CBaseEntity::GetTeamNumber((CBaseEntity *)*piVar16);
          if (iVar17 == 2) {
            pcVar2 = *(code **)(*filesystem + 100);
            iVar17 = *piVar11;
            *piVar16 = (int)piVar11;
            pcVar3 = *(code **)(iVar17 + 0xb8);
            piVar16[-1] = 0x8a9077;
            iVar17 = (*pcVar3)();
            piVar16[4] = iVar17;
            piVar16[3] = iVar8;
            piVar16[2] = (int)"[%d] %s: ";
            piVar16[1] = (int)pvVar7;
            *piVar16 = (int)filesystem;
            piVar16[-1] = 0x8a909b;
            (*pcVar2)();
            iVar17 = 0;
LAB_008a90ac:
            do {
              uVar4 = piVar11[iVar17 + 0x63d];
              if (((uVar4 != 0xffffffff) &&
                  (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10,
                  puVar10 != (undefined *)0xfffffffc)) &&
                 ((*(uint *)(puVar10 + 8) == uVar4 >> 0xc &&
                  (iVar18 = *(int *)(puVar10 + 4), iVar18 != 0)))) {
                pcVar2 = *(code **)(*filesystem + 100);
                if (*(int *)(iVar18 + 0x154) != 0) {
                  puVar12 = *(undefined1 **)(iVar18 + 0x7c);
                  piVar16[4] = *(int *)(iVar18 + 0x154);
                  piVar16[2] = (int)"%s %s, ";
                  if (puVar12 == (undefined1 *)0x0) {
                    puVar12 = &DAT_00d539c2;
                  }
                  piVar16[3] = (int)puVar12;
                  piVar16[1] = (int)pvVar7;
                  *piVar16 = (int)filesystem;
                  piVar16[-1] = 0x8a9136;
                  (*pcVar2)();
                  iVar17 = iVar17 + 1;
                  if (iVar17 == 0x38) break;
                  goto LAB_008a90ac;
                }
                puVar12 = *(undefined1 **)(iVar18 + 0x7c);
                piVar16[2] = (int)"%s, ";
                if (puVar12 == (undefined1 *)0x0) {
                  puVar12 = &DAT_00d539c2;
                }
                piVar16[3] = (int)puVar12;
                piVar16[1] = (int)pvVar7;
                *piVar16 = (int)filesystem;
                    /* try { // try from 008a986b to 008a986c has its CatchHandler @ 008a9836 */
                piVar16[-1] = 0x8a986d;
                (*pcVar2)();
              }
              iVar17 = iVar17 + 1;
            } while (iVar17 != 0x38);
            iVar17 = *filesystem;
            piVar16[2] = (int)&DAT_00cff71e;
            piVar16[1] = (int)pvVar7;
            *piVar16 = (int)filesystem;
            pcVar2 = *(code **)(iVar17 + 100);
            piVar16[-1] = 0x8a9161;
            (*pcVar2)();
          }
        }
        iVar8 = iVar8 + 1;
      } while (iVar8 <= *(int *)(gpGlobals + 0x14));
    }
    piVar16[1] = 0;
    *piVar16 = (int)gEntList;
    local_7c = 0;
    local_78 = 0;
    local_74 = 0;
    local_70 = 0;
    local_6c = 0;
                    /* try { // try from 008a91cc to 008a9788 has its CatchHandler @ 008a97dd */
    piVar16[-1] = 0x8a91d1;
    iVar8 = CGlobalEntityList::NextEnt((CGlobalEntityList *)*piVar16,(CBaseEntity *)piVar16[1]);
    while (iVar8 != 0) {
      piVar16[3] = 0;
      piVar16[2] = (int)&CBaseCombatWeapon::typeinfo;
      piVar16[1] = (int)&CBaseEntity::typeinfo;
      *piVar16 = iVar8;
      piVar16[-1] = 0x8a923a;
      iVar17 = __dynamic_cast();
      if (iVar17 == 0) {
        piVar16[3] = 0;
        piVar16[2] = (int)&CItem::typeinfo;
        piVar16[1] = (int)&CBaseEntity::typeinfo;
        *piVar16 = iVar8;
        piVar16[-1] = 0x8a925e;
        iVar17 = __dynamic_cast();
        if (iVar17 != 0) goto LAB_008a91e8;
      }
      else {
LAB_008a91e8:
        iVar18 = local_70;
        local_68[0] = iVar17;
        piVar16[2] = (int)local_68;
        piVar16[1] = iVar18;
        *piVar16 = (int)&local_7c;
        piVar16[-1] = 0x8a9204;
        CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::InsertBefore
                  ((CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>> *)*piVar16,piVar16[1],
                   (CBaseEntity **)piVar16[2]);
      }
      piVar16[1] = iVar8;
      *piVar16 = (int)gEntList;
      piVar16[-1] = 0x8a9214;
      iVar8 = CGlobalEntityList::NextEnt((CGlobalEntityList *)*piVar16,(CBaseEntity *)piVar16[1]);
    }
    iVar8 = *filesystem;
    piVar16[2] = (int)"\nPrinting ALL checkpoint items (including non-scavenge):\n";
    piVar16[1] = (int)pvVar7;
    *piVar16 = (int)filesystem;
    pcVar2 = *(code **)(iVar8 + 100);
    piVar16[-1] = 0x8a9283;
    (*pcVar2)();
    local_e0 = 0;
    while( true ) {
      *piVar16 = TheNavMesh;
      piVar16[-1] = 0x8a929a;
      iVar8 = TerrorNavMesh::GetCheckpointCount((TerrorNavMesh *)*piVar16);
      if (iVar8 <= local_e0) break;
      *piVar16 = TheNavMesh;
      piVar16[-1] = 0x8a92b3;
      CNavMesh::ClearSelectedSet((CNavMesh *)*piVar16);
      piVar16[1] = local_e0;
      *piVar16 = TheNavMesh;
      piVar16[-1] = 0x8a92ca;
      iVar8 = TerrorNavMesh::GetCheckpoint((TerrorNavMesh *)*piVar16,piVar16[1]);
      if (iVar8 != 0) {
        *piVar16 = iVar8;
        piVar16[-1] = 0x8a92da;
        iVar8 = Checkpoint::GetLargestArea((Checkpoint *)*piVar16);
        if (iVar8 != 0) {
          pcVar2 = *(code **)(*filesystem + 100);
          pcVar13 = "start";
          if (((*(byte *)(iVar8 + 300) & 0x80) == 0) &&
             (1000.0 < *(float *)(iVar8 + 0x154) || *(float *)(iVar8 + 0x154) == 1000.0)) {
            pcVar13 = "finish";
          }
          piVar16[4] = (int)pcVar13;
          iVar17 = *(int *)(iVar8 + 0x8c);
          piVar16[2] = (int)"Checkpoint %d %s \n";
          *piVar16 = (int)filesystem;
          piVar16[3] = iVar17;
          piVar16[1] = (int)pvVar7;
          piVar16[-1] = 0x8a9339;
          (*pcVar2)();
          piVar16[7] = -0x40800000;
          piVar16[6] = 0x3f800000;
          piVar16[5] = 0;
          piVar16[4] = 0xffff;
          piVar16[3] = 0;
          piVar16[2] = 0x800;
          piVar16[1] = iVar8;
          *piVar16 = (int)local_68;
          piVar16[-1] = 0x8a9378;
          FloodSelectCollector::FloodSelectCollector
                    ((FloodSelectCollector *)*piVar16,(TerrorNavArea *)piVar16[1],piVar16[2],
                     piVar16[3],piVar16[4],(float)piVar16[5],(float)piVar16[6],(float)piVar16[7]);
          piVar16[5] = -1;
          piVar16[4] = 3;
          piVar16[3] = -0x40800000;
          piVar16[2] = (int)local_68;
          piVar16[1] = iVar8 + 0x2c;
          *piVar16 = iVar8;
          piVar16[-1] = 0x8a93a3;
          SearchSurroundingAreas<FloodSelectCollector>
                    ((CNavArea *)*piVar16,(Vector *)piVar16[1],(FloodSelectCollector *)piVar16[2],
                     (float)piVar16[3],piVar16[4],piVar16[5]);
          piVar16[1] = iVar8;
          *piVar16 = TheNavMesh;
          piVar16[-1] = 0x8a93b4;
          CNavMesh::AddToSelectedSet((CNavMesh *)*piVar16,(CNavArea *)piVar16[1]);
          local_d8 = 0;
          while( true ) {
            *piVar16 = TheNavMesh;
            piVar16[-1] = 0x8a93cd;
            iVar8 = CNavMesh::GetSelecteSetSize((CNavMesh *)*piVar16);
            if (iVar8 <= local_d8) break;
            *piVar16 = TheNavMesh;
            piVar16[-1] = 0x8a93e6;
            piVar11 = (int *)CNavMesh::GetSelectedSet((CNavMesh *)*piVar16);
            uVar5 = *(undefined4 *)(*piVar11 + local_d8 * 4);
            iVar8 = 0;
LAB_008a9400:
            iVar17 = local_70;
            if (iVar8 < local_70) {
              do {
                iVar18 = *(int *)(local_7c + iVar8 * 4);
                if (iVar18 != 0) {
                  piVar16[3] = 0;
                  piVar16[2] = (int)&CBaseCombatWeapon::typeinfo;
                  piVar16[1] = (int)&CBaseEntity::typeinfo;
                  *piVar16 = iVar18;
                  piVar16[-1] = 0x8a943b;
                  iVar17 = __dynamic_cast();
                  if (iVar17 != 0) {
                    *piVar16 = iVar17;
                    piVar16[-1] = 0x8a9447;
                    iVar14 = CBaseCombatWeapon::GetOwner((CBaseCombatWeapon *)*piVar16);
                    iVar17 = local_70;
                    if (iVar14 != 0) goto LAB_008a944e;
                  }
                  if ((*(byte *)(iVar18 + 0x14d) & 8) != 0) {
                    *piVar16 = iVar18;
                    piVar16[-1] = 0x8a9479;
                    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
                  }
                  piVar16[1] = iVar18 + 0x2e0;
                  *piVar16 = uVar5;
                  piVar16[-1] = 0x8a9491;
                  cVar6 = CNavArea::Contains((CNavArea *)*piVar16,(Vector *)piVar16[1]);
                  if (cVar6 != '\0') goto LAB_008a94d7;
                  if ((*(byte *)(iVar18 + 0x14d) & 8) != 0) {
                    *piVar16 = iVar18;
                    piVar16[-1] = 0x8a94a6;
                    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
                  }
                  piVar16[1] = iVar18 + 0x2e0;
                  *piVar16 = uVar5;
                  piVar16[-1] = 0x8a94b8;
                  lVar19 = (longdouble)
                           CNavArea::GetDistanceSquaredToPoint
                                     ((CNavArea *)*piVar16,(Vector *)piVar16[1]);
                  iVar17 = local_70;
                  if ((float)lVar19 < 10000.0) goto LAB_008a94d7;
                }
LAB_008a944e:
                iVar8 = iVar8 + 1;
                if (iVar17 <= iVar8) break;
              } while( true );
            }
            local_d8 = local_d8 + 1;
          }
        }
      }
      local_e0 = local_e0 + 1;
    }
    iVar8 = filesystem[1];
    piVar16[1] = (int)pvVar7;
    *piVar16 = (int)(filesystem + 1);
    pcVar2 = *(code **)(iVar8 + 0xc);
    piVar16[-1] = 0x8a9776;
    (*pcVar2)();
    *piVar16 = (int)"Logged scavenge item info to %s\n";
    piVar16[1] = (int)param_1;
    piVar16[-1] = 0x8a9789;
    Msg();
    local_70 = 0;
    *piVar16 = (int)&local_7c;
    piVar16[-1] = 0x8a979e;
    CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)*piVar16);
    iVar8 = local_7c;
    *piVar16 = (int)&local_7c;
    local_6c = iVar8;
    piVar16[-1] = 0x8a97ac;
    CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)*piVar16);
    local_84 = 0;
    *piVar16 = (int)&local_90;
    piVar16[-1] = 0x8a97c1;
    CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int>::Purge
              ((CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int> *)*piVar16);
    local_80 = local_90;
    *piVar16 = (int)&local_90;
    piVar16[-1] = 0x8a97d8;
    CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int>::Purge
              ((CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int> *)*piVar16);
  }
  return;
LAB_008a94d7:
  puVar12 = *(undefined1 **)(iVar18 + 0x154);
  if (puVar12 == (undefined1 *)0x0) {
    pcVar2 = *(code **)(*filesystem + 100);
    if ((*(byte *)(iVar18 + 0x14d) & 8) == 0) {
      local_d4 = (double)*(float *)(iVar18 + 0x2e8);
LAB_008a9664:
      fVar1 = *(float *)(iVar18 + 0x2e4);
    }
    else {
      *piVar16 = iVar18;
      piVar16[-1] = 0x8a96e0;
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
      local_d4 = (double)*(float *)(iVar18 + 0x2e8);
      if ((*(byte *)(iVar18 + 0x14d) & 8) == 0) goto LAB_008a9664;
      *piVar16 = iVar18;
      piVar16[-1] = 0x8a9704;
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
      fVar1 = *(float *)(iVar18 + 0x2e4);
      if ((*(byte *)(iVar18 + 0x14d) & 8) != 0) {
        *piVar16 = iVar18;
        piVar16[-1] = 0x8a9728;
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
      }
    }
    local_cc = (double)fVar1;
    puVar12 = *(undefined1 **)(iVar18 + 0x7c);
    fVar1 = *(float *)(iVar18 + 0x2e0);
    piVar16[2] = (int)"%s (%f,%f,%f)\n";
    *(double *)(piVar16 + 4) = (double)fVar1;
    *(double *)(piVar16 + 8) = local_d4;
    *(double *)(piVar16 + 6) = local_cc;
    if (puVar12 == (undefined1 *)0x0) {
      puVar12 = &DAT_00d539c2;
    }
    *piVar16 = (int)filesystem;
    piVar16[3] = (int)puVar12;
    piVar16[1] = (int)pvVar7;
    piVar16[-1] = 0x8a96cc;
    (*pcVar2)();
    goto LAB_008a9588;
  }
  pcVar2 = *(code **)(*filesystem + 100);
  if ((*(byte *)(iVar18 + 0x14d) & 8) == 0) {
    local_cc = (double)*(float *)(iVar18 + 0x2e8);
LAB_008a9512:
    fVar1 = *(float *)(iVar18 + 0x2e4);
  }
  else {
    *piVar16 = iVar18;
    piVar16[-1] = 0x8a95d8;
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
    local_cc = (double)*(float *)(iVar18 + 0x2e8);
    if ((*(byte *)(iVar18 + 0x14d) & 8) == 0) {
      puVar12 = *(undefined1 **)(iVar18 + 0x154);
      goto LAB_008a9512;
    }
    *piVar16 = iVar18;
    piVar16[-1] = 0x8a9600;
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
    fVar1 = *(float *)(iVar18 + 0x2e4);
    if ((*(byte *)(iVar18 + 0x14d) & 8) != 0) {
      *piVar16 = iVar18;
      piVar16[-1] = 0x8a9624;
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)*piVar16);
    }
    puVar12 = *(undefined1 **)(iVar18 + 0x154);
  }
  local_d4 = (double)fVar1;
  fVar1 = *(float *)(iVar18 + 0x2e0);
  if (puVar12 == (undefined1 *)0x0) {
    puVar12 = &DAT_00d539c2;
  }
  puVar15 = *(undefined1 **)(iVar18 + 0x7c);
  piVar16[2] = (int)"%s %s (%f,%f,%f) \n";
  piVar16[4] = (int)puVar12;
  *(double *)(piVar16 + 9) = local_cc;
  *(double *)(piVar16 + 5) = (double)fVar1;
  if (puVar15 == (undefined1 *)0x0) {
    puVar15 = &DAT_00d539c2;
  }
  *(double *)(piVar16 + 7) = local_d4;
  piVar16[1] = (int)pvVar7;
  piVar16[3] = (int)puVar15;
  *piVar16 = (int)filesystem;
  piVar16[-1] = 0x8a9588;
  (*pcVar2)();
LAB_008a9588:
  iVar17 = local_7c;
  iVar18 = (local_70 - iVar8) + -1;
  if (0 < iVar18) {
    piVar16[2] = iVar18 * 4;
    piVar16[1] = iVar17 + 4 + iVar8 * 4;
    *piVar16 = iVar17 + iVar8 * 4;
    piVar16[-1] = 0x8a95ca;
    _V_memmove((void *)*piVar16,(void *)piVar16[1],piVar16[2]);
  }
  local_70 = local_70 + -1;
  goto LAB_008a9400;
}

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)