L L4D2node

CDirectorItemManager::CollectItemLocations<CHandle<CBaseEntity>>

0x008abe80 · 623 bytes · __thiscall

_ZN20CDirectorItemManager20CollectItemLocationsI7CHandleI11CBaseEntityEEEvPKcP20EntityPopulationInfoIT_Ebb

Decompiled

void (5 params)

/* void CDirectorItemManager::CollectItemLocations<CHandle<CBaseEntity> >(char const*,
   EntityPopulationInfo<CHandle<CBaseEntity> >*, bool, bool) */

void __thiscall
CDirectorItemManager::CollectItemLocations<CHandle<CBaseEntity>>
          (CDirectorItemManager *this,char *param_1,EntityPopulationInfo *param_2,bool param_3,
          bool param_4)

{
  CBaseEntity CVar1;
  char cVar2;
  CBaseEntity *this_00;
  undefined4 *puVar3;
  int iVar4;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  param_2[4] = (EntityPopulationInfo)0x0;
  *(char **)param_2 = param_1;
  *(undefined4 *)(param_2 + 0x28) = 0;
  param_2[0x30] = (EntityPopulationInfo)param_4;
  this_00 = (CBaseEntity *)
            CGlobalEntityList::FindEntityByClassname
                      ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,param_1);
  do {
    if (this_00 == (CBaseEntity *)0x0) {
      CollateEncounters<CHandle<CBaseEntity>>
                (this,param_2,param_3,*(float *)(director_item_cluster_range._28_4_ + 0x2c),
                 (CUtlVector *)(this + 0x41c));
      if (*(int *)(director_debug_scavenge_items._28_4_ + 0x30) != 0) {
        Msg("Collected %d total %s items in %d encounters \n",*(undefined4 *)(param_2 + 0x28),
            param_1,*(undefined4 *)(param_2 + 0x14));
      }
      return;
    }
    if (((byte)this_00[0x14c] & 1) == 0) {
      cVar2 = CTerrorGameRules::IsScavengeMode();
      if ((cVar2 == '\0') && (cVar2 = CTerrorGameRules::IsSurvivalMode(), cVar2 == '\0')) {
        if (((byte)this_00[0x148] & 2) != 0) goto LAB_008abed8;
        if (((byte)this_00[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
        }
        iVar4 = CNavMesh::GetNearestNavArea
                          (TheNavMesh,(Vector *)(this_00 + 0x2e0),false,500.0,true,true,false);
        if (iVar4 == 0) goto LAB_008abf0c;
        if ((*(uint *)(iVar4 + 300) & 0x880) != 0) goto LAB_008abed8;
        CVar1 = this_00[0x14d];
      }
      else {
LAB_008abf0c:
        CVar1 = this_00[0x14d];
      }
      if (((byte)CVar1 & 8) == 0) {
        local_20 = 0xffffffff;
        local_3c = *(undefined4 *)(this_00 + 0x2e0);
        local_38 = *(undefined4 *)(this_00 + 0x2e4);
        local_34 = *(undefined4 *)(this_00 + 0x2e8);
      }
      else {
        local_20 = 0xffffffff;
        CBaseEntity::CalcAbsolutePosition(this_00);
        local_3c = *(undefined4 *)(this_00 + 0x2e0);
        local_38 = *(undefined4 *)(this_00 + 0x2e4);
        local_34 = *(undefined4 *)(this_00 + 0x2e8);
        if ((*(uint *)(this_00 + 0x14c) & 0x800) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
        }
      }
      local_30 = *(undefined4 *)(this_00 + 0x37c);
      local_24 = 0;
      local_2c = *(undefined4 *)(this_00 + 0x380);
      local_28 = *(undefined4 *)(this_00 + 900);
      puVar3 = (undefined4 *)(**(code **)(*(int *)this_00 + 0xc))(this_00);
      local_20 = *puVar3;
      CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int>>
      ::InsertBefore((CUtlVector<EntityLocationInfo<CHandle<CBaseEntity>>,CUtlMemory<EntityLocationInfo<CHandle<CBaseEntity>>,int>>
                      *)(param_2 + 0x1c),*(int *)(param_2 + 0x28),(EntityLocationInfo *)&local_3c);
    }
LAB_008abed8:
    this_00 = (CBaseEntity *)
              CGlobalEntityList::FindEntityByClassname
                        ((CGlobalEntityList *)gEntList,this_00,param_1);
  } while( true );
}

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)