L L4D2node

CParticleCollection::InitStorage

0x00bcadb0 · 684 bytes · __thiscall

_ZN19CParticleCollection11InitStorageEP25CParticleSystemDefinition

Decompiled

undefined (2 params)

/* CParticleCollection::InitStorage(CParticleSystemDefinition*) */

void __thiscall
CParticleCollection::InitStorage(CParticleCollection *this,CParticleSystemDefinition *param_1)

{
  size_t sVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  undefined4 uVar5;
  int iVar6;
  void *pvVar7;
  uint uVar8;
  int iVar9;
  uint uVar10;
  int iVar11;
  CParticleCollection *pCVar12;
  int iVar13;
  int local_2c;
  int local_28;
  int local_24;
  
  iVar11 = 5000;
  if (*(int *)(param_1 + 0x2e0) < 0x1389) {
    iVar11 = *(int *)(param_1 + 0x2e0);
  }
  *(int *)(this + 0x50) = iVar11;
  iVar13 = iVar11 + 3;
  if (iVar11 + 3 < 0) {
    iVar13 = iVar11 + 6;
  }
  *(int *)(this + 0x4c) = (iVar13 >> 2) * 4 + 4;
  uVar5 = memalign(0x10,0x490);
  *(undefined4 *)(this + 0xc0) = uVar5;
  *(undefined4 *)(this + 0x314) = uVar5;
  uVar10 = *(uint *)(param_1 + 0xc);
  *(uint *)(this + 200) = uVar10;
  uVar8 = *(uint *)(param_1 + 8);
  *(uint *)(this + 0xcc) = uVar8;
  uVar8 = uVar8 | uVar10;
  iVar11 = 0;
  uVar10 = *(uint *)(param_1 + 0xc) & *(uint *)(param_1 + 0x10) & *(uint *)(param_1 + 8);
  *(uint *)(this + 0xd0) = uVar10;
  iVar13 = 0;
  uVar2 = *(uint *)(param_1 + 0xc);
  uVar3 = *(uint *)(param_1 + 0x10);
  uVar4 = *(uint *)(param_1 + 8);
  iVar6 = 3;
  iVar9 = 0;
  while( true ) {
    if (((int)uVar8 >> ((byte)iVar9 & 0x1f) & 1U) != 0) {
      iVar11 = iVar11 + iVar6;
    }
    if (((int)uVar10 >> ((byte)iVar9 & 0x1f) & 1U) != 0) {
      iVar13 = iVar6 + iVar13;
    }
    iVar9 = iVar9 + 1;
    if (iVar9 == 0x18) break;
    iVar6 = (-(uint)((0x768045 >> ((byte)iVar9 & 0x1f) & 1U) == 0) & 0xfffffffe) + 3;
  }
  sVar1 = iVar11 * *(int *)(this + 0x4c) * 4 + 0x30;
  pvVar7 = (void *)memalign(0x10,sVar1);
  *(void **)(this + 0xb8) = pvVar7;
  *(size_t *)(this + 0xb4) = sVar1;
  memset(pvVar7,0,sVar1);
  if (iVar13 != 0) {
    sVar1 = iVar13 * *(int *)(this + 0x4c) * 4 + 0x30;
    pvVar7 = (void *)memalign(0x10,sVar1);
    *(void **)(this + 0xbc) = pvVar7;
    memset(pvVar7,0,sVar1);
  }
  uVar10 = 0;
  local_24 = 0;
  local_28 = *(int *)(this + 0xb8);
  local_2c = *(int *)(this + 0xbc);
  pCVar12 = this + 0x194;
  iVar11 = 3;
  do {
    if ((uVar8 >> (uVar10 & 0x1f) & 1) == 0) {
      iVar13 = *(int *)(this + 0x314);
      *(int *)(pCVar12 + -0x60) = 0;
      *(int *)(pCVar12 + -0xc0) = local_24 + iVar13;
      if ((*(uint *)(param_1 + 0x10) >> (uVar10 & 0x1f) & 1) == 0) goto LAB_00bcafcf;
LAB_00bcaf5a:
      if ((*(uint *)(this + 0xd0) >> (uVar10 & 0x1f) & 1) == 0) {
        if (((uVar2 & uVar3 & ~uVar4) >> (uVar10 & 0x1f) & 1) == 0) {
          iVar11 = *(int *)(this + 0x314);
          *(int *)(pCVar12 + 0x60) = 0;
          *(int *)pCVar12 = local_24 + iVar11;
        }
        else {
          *(int *)pCVar12 = *(int *)(pCVar12 + -0xc0);
          *(int *)(pCVar12 + 0x60) = *(int *)(pCVar12 + -0x60);
        }
      }
      else {
        *(int *)(pCVar12 + 0x60) = iVar11 * 4;
        *(int *)pCVar12 = local_2c;
        local_2c = local_2c + iVar11 * *(int *)(this + 0x4c) * 4;
      }
    }
    else {
      *(int *)(pCVar12 + -0x60) = iVar11 * 4;
      *(int *)(pCVar12 + -0xc0) = local_28;
      local_28 = local_28 + *(int *)(this + 0x4c) * iVar11 * 4;
      if ((*(uint *)(param_1 + 0x10) >> (uVar10 & 0x1f) & 1) != 0) goto LAB_00bcaf5a;
LAB_00bcafcf:
      *(int *)pCVar12 = 0;
      *(int *)(pCVar12 + 0x60) = 0;
    }
    if (uVar10 == 0x17) {
      return;
    }
    uVar10 = uVar10 + 1;
    pCVar12 = pCVar12 + 4;
    local_24 = local_24 + 0x30;
    iVar11 = (-(uint)((0x768045 >> ((byte)uVar10 & 0x1f) & 1U) == 0) & 0xfffffffe) + 3;
  } 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)