L L4D2node

CParticleSystemMgr::Init

0x00bd1020 · 496 bytes · __thiscall

_ZN18CParticleSystemMgr4InitEP20IParticleSystemQueryb

Decompiled

undefined (3 params)

/* CParticleSystemMgr::Init(IParticleSystemQuery*, bool) */

undefined4 __thiscall
CParticleSystemMgr::Init(CParticleSystemMgr *this,IParticleSystemQuery *param_1,bool param_2)

{
  CParticleSystemMgr CVar1;
  int *piVar2;
  int iVar3;
  undefined4 *puVar4;
  KeyValues *this_00;
  undefined4 uVar5;
  uint uVar6;
  IParticleOperatorDefinition *local_20 [4];
  
  if ((g_pMaterialSystem != (int *)0x0) &&
     (iVar3 = (**(code **)(*g_pMaterialSystem + 8))(g_pMaterialSystem,"VMaterialSystem080"),
     iVar3 == 0)) {
    Msg("CParticleSystemMgr compiled using an old IMaterialSystem\n");
    return 0;
  }
  if ((this[0x13d] == (CParticleSystemMgr)0x0) || (param_1 == (IParticleSystemQuery *)0x0)) {
    CVar1 = this[0x13c];
  }
  else {
    this[0x13d] = (CParticleSystemMgr)0x0;
    CVar1 = this[0x13c];
    *(IParticleSystemQuery **)(this + 0xf0) = param_1;
  }
  if (CVar1 == (CParticleSystemMgr)0x0) {
    puVar4 = ::operator_new(0x60);
    *puVar4 = 0;
    puVar4[1] = 0;
    puVar4[2] = 0;
    puVar4[3] = 0;
    puVar4[4] = 0;
                    /* try { // try from 00bd10ee to 00bd10f2 has its CatchHandler @ 00bd1230 */
    CUtlSymbolTable::CUtlSymbolTable((CUtlSymbolTable *)(puVar4 + 5),0,0x20,true);
    puVar4[0x13] = 0;
    puVar4[0x14] = 0;
    puVar4[0x15] = 0;
    puVar4[0x16] = 0;
    puVar4[0x17] = 0;
    *(undefined4 **)(this + 0x8c) = puVar4;
    uVar6 = *(uint *)(this + 0x5c);
    local_20[0] = (IParticleOperatorDefinition *)&s_ChildOperatorDefinition;
    CUtlVector<IParticleOperatorDefinition*,CUtlMemory<IParticleOperatorDefinition*,int>>::
    InsertBefore((CUtlVector<IParticleOperatorDefinition*,CUtlMemory<IParticleOperatorDefinition*,int>>
                  *)(this + 0x50),uVar6,local_20);
    piVar2 = g_pMaterialSystem;
    *(undefined4 *)(this + 0x108) = 0;
    if (piVar2 != (int *)0x0) {
      this_00 = KeyValues::operator_new((KeyValues *)0x2c,uVar6);
                    /* try { // try from 00bd117c to 00bd1180 has its CatchHandler @ 00bd121e */
      KeyValues::KeyValues(this_00,"DepthWrite",(IKeyValuesSystem *)0x0,false);
      KeyValues::SetInt(this_00,"$no_fullbright",1);
      KeyValues::SetInt(this_00,"$model",0);
      KeyValues::SetInt(this_00,"$alphatest",0);
      uVar5 = (**(code **)(*g_pMaterialSystem + 0x118))
                        (g_pMaterialSystem,"__particlesDepthWrite",this_00);
      *(undefined4 *)(this + 0x108) = uVar5;
    }
    SeedRandSIMD(0xbc614e);
    this[0x13c] = (CParticleSystemMgr)0x1;
  }
  this[0x13f] = (CParticleSystemMgr)param_2;
  return 1;
}

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)