L L4D2node

CDirectorItemManager::CollateEncounters<CHandle<CWeaponSpawnConfigurable>>

0x008ab910 · 475 bytes · __thiscall

_ZN20CDirectorItemManager17CollateEncountersI7CHandleI24CWeaponSpawnConfigurableEEEvP20EntityPopulationInfoIT_EbfP10CUtlVectorIP18EntityLocationInfoIS5_E10CUtlMemoryISB_iEE

Decompiled

void (5 params)

/* void CDirectorItemManager::CollateEncounters<CHandle<CWeaponSpawnConfigurable>
   >(EntityPopulationInfo<CHandle<CWeaponSpawnConfigurable> >*, bool, float,
   CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable> >*,
   CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable> >*, int> >*) */

void __thiscall
CDirectorItemManager::CollateEncounters<CHandle<CWeaponSpawnConfigurable>>
          (CDirectorItemManager *this,EntityPopulationInfo *param_1,bool param_2,float param_3,
          CUtlVector *param_4)

{
  bool bVar1;
  int iVar2;
  int iVar3;
  Vector *pVVar4;
  int iVar5;
  int iVar6;
  Vector *local_38;
  Vector *local_20 [4];
  
  *(undefined4 *)(param_1 + 0x14) = 0;
  if (0 < *(int *)(param_1 + 0x28)) {
    iVar6 = 1;
    do {
      while( true ) {
        iVar5 = (iVar6 + 0x7ffffff) * 0x20;
        local_20[0] = (Vector *)(*(int *)(param_1 + 0x1c) + iVar5);
        if (param_1[0x30] != (EntityPopulationInfo)0x0) break;
        CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,int>>
        ::InsertBefore((CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,int>>
                        *)(param_1 + 8),*(int *)(param_1 + 0x14),(EntityLocationInfo **)local_20);
        bVar1 = *(int *)(param_1 + 0x28) <= iVar6;
        iVar6 = iVar6 + 1;
        if (bVar1) {
          return;
        }
      }
      if (*(int *)(local_20[0] + 0x18) == 0) {
        iVar2 = CNavMesh::GetNearestNavArea(TheNavMesh,local_20[0],false,500.0,true,true,false);
        if (((iVar2 == 0) || (param_4 == (CUtlVector *)0x0)) ||
           ((*(byte *)(iVar2 + 300) & 0x40) == 0)) {
          CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,int>>
          ::InsertBefore((CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,int>>
                          *)(param_1 + 8),*(int *)(param_1 + 0x14),(EntityLocationInfo **)local_20);
        }
        else if (!param_2) {
          CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,int>>
          ::InsertBefore((CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>*,int>>
                          *)param_4,*(int *)(param_4 + 0xc),(EntityLocationInfo **)local_20);
        }
        if (*(int *)(param_1 + 0x28) <= iVar6) {
          return;
        }
        iVar5 = iVar5 + 0x20;
        local_38 = local_20[0];
        iVar2 = iVar6;
        do {
          while ((pVVar4 = (Vector *)(*(int *)(param_1 + 0x1c) + iVar5),
                 *(float *)(pVVar4 + 0x18) == 0.0 &&
                 ((*(float *)(local_20[0] + 4) - *(float *)(pVVar4 + 4)) *
                  (*(float *)(local_20[0] + 4) - *(float *)(pVVar4 + 4)) +
                  (*(float *)local_20[0] - *(float *)pVVar4) *
                  (*(float *)local_20[0] - *(float *)pVVar4) +
                  (*(float *)(local_20[0] + 8) - *(float *)(pVVar4 + 8)) *
                  (*(float *)(local_20[0] + 8) - *(float *)(pVVar4 + 8)) < param_3 * param_3))) {
            iVar2 = iVar2 + 1;
            iVar5 = iVar5 + 0x20;
            *(Vector **)(local_38 + 0x18) = pVVar4;
            *(Vector **)(pVVar4 + 0x18) = local_20[0];
            iVar3 = *(int *)(param_1 + 0x28);
            local_38 = pVVar4;
            if (iVar3 <= iVar2) goto LAB_008ab96c;
          }
          iVar3 = *(int *)(param_1 + 0x28);
          iVar2 = iVar2 + 1;
          iVar5 = iVar5 + 0x20;
        } while (iVar2 < iVar3);
      }
      else {
        iVar3 = *(int *)(param_1 + 0x28);
      }
LAB_008ab96c:
      bVar1 = iVar6 < iVar3;
      iVar6 = iVar6 + 1;
    } while (bVar1);
  }
  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)