L L4D2node

CSoundControllerImp::SoundCreate

0x004c09c0 · 531 bytes · __thiscall

_ZN19CSoundControllerImp11SoundCreateER16IRecipientFilteriRK11EmitSound_t

Decompiled

undefined (4 params)

/* CSoundControllerImp::SoundCreate(IRecipientFilter&, int, EmitSound_t const&) */

CSoundPatch * __thiscall
CSoundControllerImp::SoundCreate
          (CSoundControllerImp *this,IRecipientFilter *param_1,int param_2,EmitSound_t *param_3)

{
  int iVar1;
  CSoundPatch *this_00;
  uint uVar2;
  undefined *puVar3;
  undefined4 uVar4;
  uint uVar5;
  undefined4 uVar6;
  float fVar7;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  this_00 = (CSoundPatch *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)CSoundPatch::s_Allocator,0x80);
  *(undefined4 *)this_00 = 0;
  *(undefined4 *)(this_00 + 4) = 0;
  *(undefined4 *)(this_00 + 8) = 0;
  this_00[0xc] = (CSoundPatch)0x0;
  *(undefined4 *)(this_00 + 0x10) = 0;
  *(undefined4 *)(this_00 + 0x14) = 0;
  *(undefined4 *)(this_00 + 0x18) = 0;
  this_00[0x1c] = (CSoundPatch)0x0;
  *(undefined4 *)(this_00 + 0x38) = 0xffffffff;
  *(undefined ***)(this_00 + 0x60) = &PTR__CCopyRecipientFilter_00c1e5c8;
  *(undefined4 *)(this_00 + 100) = 0;
  *(undefined4 *)(this_00 + 0x68) = 0;
  *(undefined4 *)(this_00 + 0x6c) = 0;
  *(undefined4 *)(this_00 + 0x70) = 0;
  *(undefined4 *)(this_00 + 0x74) = 0;
  *(undefined4 *)(this_00 + 0x78) = 0;
  CSoundPatch::g_SoundPatchCount = CSoundPatch::g_SoundPatchCount + 1;
  *(undefined4 *)(this_00 + 0x30) = 0;
  *(undefined4 *)(this_00 + 0x34) = 0;
  uVar6 = *(undefined4 *)(soundpatch_captionlength._28_4_ + 0x2c);
  *(undefined4 *)(this_00 + 0x44) = 0;
  *(undefined4 *)(this_00 + 0x48) = 0;
  *(undefined4 *)(this_00 + 0x7c) = uVar6;
  *(undefined4 *)(this_00 + 0x4c) = 0;
  *(undefined4 *)(this_00 + 0x40) = 0xffffffff;
  *(undefined4 *)(this_00 + 0x20) = 0xffffffff;
  if (param_2 == -1) {
    local_20 = *(undefined4 *)(param_3 + 0x18);
    uVar5 = 0;
    uVar6 = *(undefined4 *)param_3;
    local_24 = *(undefined4 *)(param_3 + 0xc);
    local_28 = *(undefined4 *)(param_3 + 4);
    uVar2 = 0;
  }
  else {
    if (*(int *)(g_pEntityList + param_2 * 0x10 + 4) == 0) {
      local_20 = *(undefined4 *)(param_3 + 0x18);
      uVar6 = *(undefined4 *)param_3;
      local_24 = *(undefined4 *)(param_3 + 0xc);
      local_28 = *(undefined4 *)(param_3 + 4);
      uVar4 = 0;
      goto LAB_004c0afb;
    }
    uVar4 = 0;
    uVar2 = *(int *)(g_pEntityList + param_2 * 0x10 + 8) << 0xc | param_2;
    local_20 = *(undefined4 *)(param_3 + 0x18);
    local_24 = *(undefined4 *)(param_3 + 0xc);
    local_28 = *(undefined4 *)(param_3 + 4);
    uVar6 = *(undefined4 *)param_3;
    if (uVar2 == 0xffffffff) goto LAB_004c0afb;
    uVar5 = param_2 & 0xfff;
  }
  puVar3 = g_pEntityList + uVar5 * 0x10;
  if ((puVar3 == (undefined *)0xfffffffc) || (*(uint *)(puVar3 + 8) != uVar2 >> 0xc)) {
    uVar4 = 0;
  }
  else {
    uVar4 = *(undefined4 *)(puVar3 + 4);
  }
LAB_004c0afb:
  CSoundPatch::Init(this_00,param_1,uVar4,uVar6,local_28,local_24,local_20,0x3f800000);
  fVar7 = *(float *)(param_3 + 8);
  *(uint *)(this_00 + 0x50) = *(uint *)(this_00 + 0x50) | 1;
  if (1.0 <= fVar7) {
    fVar7 = 1.0;
  }
  CSoundEnvelope::SetTarget((CSoundEnvelope *)(this_00 + 0x10),fVar7,0.0);
  iVar1 = *(int *)(param_3 + 0x14);
  *(uint *)(this_00 + 0x50) = *(uint *)(this_00 + 0x50) | 2;
  CSoundEnvelope::SetTarget((CSoundEnvelope *)this_00,(float)iVar1,0.0);
  if (((byte)param_3[0x10] & 0x80) != 0) {
    *(undefined4 *)(this_00 + 0x54) = 0x80;
  }
  return this_00;
}

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)