L L4D2node

CParticleSystemMgr::BuildBatchList

0x00bd4700 · 714 bytes · __thiscall

_ZN18CParticleSystemMgr14BuildBatchListEiP17IMatRenderContextR10CUtlVectorINS_7Batch_tE10CUtlMemoryIS3_iEE

Decompiled

undefined (4 params)

/* CParticleSystemMgr::BuildBatchList(int, IMatRenderContext*,
   CUtlVector<CParticleSystemMgr::Batch_t, CUtlMemory<CParticleSystemMgr::Batch_t, int> >&) */

void __thiscall
CParticleSystemMgr::BuildBatchList
          (CParticleSystemMgr *this,int param_1,IMatRenderContext *param_2,CUtlVector *param_3)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  int iVar6;
  int iVar7;
  undefined4 *puVar8;
  int iVar9;
  int *piVar10;
  int local_58;
  int local_50;
  int local_40;
  int local_38;
  int local_34;
  int *local_30;
  int local_2c;
  int local_28;
  int local_24;
  int local_20 [4];
  
  CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>::RemoveAll
            ((CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>> *)
             param_3);
  iVar3 = param_1 * 0x18;
  uVar4 = (**(code **)(*(int *)param_2 + 0x1f0))
                    (param_2,*(undefined4 *)(*(int *)(this + 0xf4) + iVar3));
  uVar5 = (**(code **)(*(int *)param_2 + 500))(param_2);
  iVar6 = CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>::
          InsertBefore((CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>
                        *)param_3,*(int *)(param_3 + 0xc));
  piVar10 = (int *)(iVar6 * 0x1c + *(int *)param_3);
  *piVar10 = 0;
  piVar10[1] = 0;
  iVar6 = *(int *)(this + 0xf4);
  iVar9 = *(int *)(iVar6 + 0x10 + iVar3);
  if (0 < iVar9) {
    local_58 = 0;
    do {
      iVar6 = *(int *)(*(int *)(iVar6 + 4 + iVar3) + local_58 * 4);
      if ((*(int *)(iVar6 + 0x48) != 0) &&
         (iVar2 = *(int *)(*(int *)(iVar6 + 0x48) + 0x328), 0 < iVar2)) {
        local_50 = 0;
        do {
          if (0 < *(int *)(iVar6 + 0x30)) {
            local_40 = 0;
            do {
              while( true ) {
                iVar7 = *(int *)(iVar6 + 0x48);
                if (iVar7 == 0) {
                  local_30 = (int *)0x0;
                  local_2c = 0;
                }
                else {
                  local_30 = *(int **)(*(int *)(iVar7 + 0x31c) + local_50 * 4);
                  local_2c = *(int *)(iVar6 + 0x6c) +
                             *(int *)(*(int *)(iVar7 + 0x3a8) + local_50 * 4);
                }
                local_28 = local_40;
                local_34 = iVar6;
                local_24 = (**(code **)(*local_30 + 0x34))
                                     (local_30,iVar6,local_2c,local_40,uVar4,uVar5,local_20,
                                      &local_38);
                local_40 = local_40 + local_24;
                if (0 < local_24) break;
                if (*piVar10 == 0) goto LAB_00bd48de;
                iVar7 = CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>
                        ::InsertBefore((CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>
                                        *)param_3,*(int *)(param_3 + 0xc));
                piVar10 = (int *)(iVar7 * 0x1c + *(int *)param_3);
                *piVar10 = 0;
                piVar10[1] = 0;
                if (*(int *)(iVar6 + 0x30) <= local_40) goto LAB_00bd48de;
              }
              *piVar10 = *piVar10 + local_20[0];
              piVar10[1] = piVar10[1] + local_38;
              CUtlVector<CParticleSystemMgr::BatchStep_t,CUtlMemory<CParticleSystemMgr::BatchStep_t,int>>
              ::InsertBefore((CUtlVector<CParticleSystemMgr::BatchStep_t,CUtlMemory<CParticleSystemMgr::BatchStep_t,int>>
                              *)(piVar10 + 2),piVar10[5],(BatchStep_t *)&local_34);
            } while (local_40 < *(int *)(iVar6 + 0x30));
          }
LAB_00bd48de:
          local_50 = local_50 + 1;
        } while (local_50 != iVar2);
      }
      local_58 = local_58 + 1;
      if (local_58 == iVar9) goto LAB_00bd4920;
      iVar6 = *(int *)(this + 0xf4);
    } while( true );
  }
LAB_00bd4935:
  iVar6 = *(int *)(param_3 + 0xc);
  iVar3 = (iVar6 + -1) * 0x1c;
  iVar9 = *(int *)param_3 + iVar3;
  *(undefined4 *)(iVar9 + 0x14) = 0;
  CUtlMemory<CParticleSystemMgr::BatchStep_t,int>::Purge
            ((CUtlMemory<CParticleSystemMgr::BatchStep_t,int> *)(iVar9 + 8));
  *(undefined4 *)(iVar9 + 0x18) = *(undefined4 *)(iVar9 + 8);
  CUtlMemory<CParticleSystemMgr::BatchStep_t,int>::Purge
            ((CUtlMemory<CParticleSystemMgr::BatchStep_t,int> *)(iVar9 + 8));
  if (*(int *)(param_3 + 0xc) < 1) {
    return;
  }
  iVar9 = *(int *)(param_3 + 0xc) + -1;
  if (iVar6 + -1 != iVar9) {
    puVar1 = (undefined4 *)(*(int *)param_3 + iVar3);
    puVar8 = (undefined4 *)(*(int *)param_3 + iVar9 * 0x1c);
    *puVar1 = *puVar8;
    puVar1[1] = puVar8[1];
    puVar1[2] = puVar8[2];
    puVar1[3] = puVar8[3];
    puVar1[4] = puVar8[4];
    puVar1[5] = puVar8[5];
    puVar1[6] = puVar8[6];
    iVar9 = *(int *)(param_3 + 0xc) + -1;
  }
  *(int *)(param_3 + 0xc) = iVar9;
  return;
LAB_00bd4920:
  if ((0 < *piVar10) && (0 < piVar10[1])) {
    return;
  }
  goto LAB_00bd4935;
}

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)