L L4D2node

CSoundControllerImp::SoundCreate

0x004c0690 · 415 bytes · __thiscall

_ZN19CSoundControllerImp11SoundCreateER16IRecipientFilteriiPKcfPK6Vectorf

Decompiled

undefined (8 params)

/* CSoundControllerImp::SoundCreate(IRecipientFilter&, int, int, char const*, float, Vector const*,
   float) */

CSoundPatch * __thiscall
CSoundControllerImp::SoundCreate
          (CSoundControllerImp *this,IRecipientFilter *param_1,int param_2,int param_3,char *param_4
          ,float param_5,Vector *param_6,float param_7)

{
  CSoundPatch *pCVar1;
  undefined *puVar2;
  undefined4 uVar3;
  uint uVar4;
  int iVar5;
  
  pCVar1 = (CSoundPatch *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)CSoundPatch::s_Allocator,0x80);
  *(undefined4 *)pCVar1 = 0;
  *(undefined4 *)(pCVar1 + 4) = 0;
  puVar2 = g_pEntityList;
  *(undefined4 *)(pCVar1 + 8) = 0;
  pCVar1[0xc] = (CSoundPatch)0x0;
  *(undefined4 *)(pCVar1 + 0x10) = 0;
  *(undefined4 *)(pCVar1 + 0x14) = 0;
  *(undefined4 *)(pCVar1 + 0x18) = 0;
  pCVar1[0x1c] = (CSoundPatch)0x0;
  uVar3 = soundpatch_captionlength._28_4_;
  *(undefined4 *)(pCVar1 + 0x38) = 0xffffffff;
  *(undefined ***)(pCVar1 + 0x60) = &PTR__CCopyRecipientFilter_00c1e5c8;
  *(undefined4 *)(pCVar1 + 100) = 0;
  *(undefined4 *)(pCVar1 + 0x68) = 0;
  *(undefined4 *)(pCVar1 + 0x6c) = 0;
  *(undefined4 *)(pCVar1 + 0x70) = 0;
  *(undefined4 *)(pCVar1 + 0x74) = 0;
  *(undefined4 *)(pCVar1 + 0x78) = 0;
  CSoundPatch::g_SoundPatchCount = CSoundPatch::g_SoundPatchCount + 1;
  *(undefined4 *)(pCVar1 + 0x30) = 0;
  *(undefined4 *)(pCVar1 + 0x34) = 0;
  uVar3 = *(undefined4 *)(uVar3 + 0x2c);
  uVar4 = 0;
  *(undefined4 *)(pCVar1 + 0x44) = 0;
  *(undefined4 *)(pCVar1 + 0x7c) = uVar3;
  *(undefined4 *)(pCVar1 + 0x48) = 0;
  *(undefined4 *)(pCVar1 + 0x4c) = 0;
  *(undefined4 *)(pCVar1 + 0x40) = 0xffffffff;
  *(undefined4 *)(pCVar1 + 0x20) = 0xffffffff;
  if (param_2 != -1) {
    puVar2 = g_pEntityList;
    if (*(int *)(g_pEntityList + param_2 * 0x10 + 4) == 0) {
      uVar4 = 0xffffffff;
    }
    else {
      uVar4 = *(int *)(g_pEntityList + param_2 * 0x10 + 8) << 0xc | param_2;
    }
  }
  iVar5 = 0;
  if (param_5 != 0.0) {
    iVar5 = (int)(20.0 / param_5 + 50.0);
  }
  if (((uVar4 == 0xffffffff) ||
      (puVar2 = puVar2 + (uVar4 & 0xfff) * 0x10, puVar2 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar2 + 8) != uVar4 >> 0xc)) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined4 *)(puVar2 + 4);
  }
  CSoundPatch::Init(pCVar1,param_1,uVar3,param_3,param_4,iVar5,param_6,param_7);
  return pCVar1;
}

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)