L L4D2node

CParticleSystemMgr::FindOrLoadSheet

0x00bd0050 · 481 bytes · __thiscall

_ZN18CParticleSystemMgr15FindOrLoadSheetEP25CParticleSystemDefinition

Decompiled

undefined (2 params)

/* CParticleSystemMgr::FindOrLoadSheet(CParticleSystemDefinition*) */

CSheet * __thiscall
CParticleSystemMgr::FindOrLoadSheet(CParticleSystemMgr *this,CParticleSystemDefinition *param_1)

{
  ushort uVar1;
  char cVar2;
  int *piVar3;
  void *pvVar4;
  CSheet *this_00;
  ushort local_62;
  uint local_60;
  int local_58;
  ushort local_54 [34];
  
  if (this[0x13e] != (CParticleSystemMgr)0x0) {
    if (param_1[0x2c1] == (CParticleSystemDefinition)0x0) {
      param_1[0x2c1] = (CParticleSystemDefinition)0x1;
      *(undefined2 *)(param_1 + 700) = 0xffff;
      if ((((byte)param_1[0x41e] & 1) != 0) &&
         (piVar3 = *(int **)(param_1 + 0x144), piVar3 != (int *)0x0)) {
        piVar3 = (int *)(**(code **)(*piVar3 + 0xbc))(piVar3,"$basetexture",&s_nBaseTextureVarCache)
        ;
        if (piVar3 != (int *)0x0) {
          cVar2 = (**(code **)(*piVar3 + 0x44))(piVar3);
          if (cVar2 != '\0') {
            piVar3 = (int *)(**(code **)*piVar3)(piVar3);
            if (piVar3 != (int *)0x0) {
              cVar2 = (**(code **)(*piVar3 + 0x3c))(piVar3);
              if (cVar2 == '\0') {
                uVar1 = *(ushort *)(this + 0xb6);
                (**(code **)*piVar3)(piVar3);
                CUtlSymbolTable::AddString((char *)local_54);
                local_60 = (uint)local_54[0];
                local_62 = local_54[0];
                if (*(int *)(this + 0x9c) <= (int)local_60) {
                  CUtlVector<CSheet*,CUtlMemory<CSheet*,int>>::EnsureCount
                            ((CUtlVector<CSheet*,CUtlMemory<CSheet*,int>> *)(this + 0x90),
                             local_60 + 1);
                  local_60 = (uint)local_54[0];
                  local_62 = local_54[0];
                }
                if (local_60 < uVar1) {
                  this_00 = *(CSheet **)(*(int *)(this + 0x90) + local_60 * 4);
                }
                else {
                  pvVar4 = (void *)(**(code **)(*piVar3 + 0x24))(piVar3,0x10,&local_58);
                  if (pvVar4 == (void *)0x0) {
                    this_00 = (CSheet *)0x0;
                  }
                  else {
                    CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_54,pvVar4,local_58,8);
                    /* try { // try from 00bd0210 to 00bd0214 has its CatchHandler @ 00bd0269 */
                    this_00 = ::operator_new(900);
                    /* try { // try from 00bd0221 to 00bd0225 has its CatchHandler @ 00bd024c */
                    CSheet::CSheet(this_00,(CUtlBuffer *)local_54);
                    CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
                  }
                  *(CSheet **)(*(int *)(this + 0x90) + local_60 * 4) = this_00;
                }
                param_1[0x2c1] = (CParticleSystemDefinition)0x1;
                *(ushort *)(param_1 + 700) = local_62;
                return this_00;
              }
            }
          }
        }
      }
    }
    else if (*(ushort *)(param_1 + 700) != 0xffff) {
      return *(CSheet **)(*(int *)(this + 0x90) + (uint)*(ushort *)(param_1 + 700) * 4);
    }
  }
  return (CSheet *)0x0;
}

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)