L L4D2node

CSoundPatch::StartSound

0x004befa0 · 687 bytes · __thiscall

_ZN11CSoundPatch10StartSoundEf

Decompiled

undefined (2 params)

/* CSoundPatch::StartSound(float) */

void __thiscall CSoundPatch::StartSound(CSoundPatch *this,float param_1)

{
  uint uVar1;
  int iVar2;
  char *pcVar3;
  undefined *puVar4;
  char *pcVar5;
  undefined4 local_60;
  char *local_5c;
  float local_58;
  undefined4 local_54;
  uint local_50;
  int local_4c;
  CSoundPatch *local_48;
  float local_44;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined2 local_20;
  
  *(undefined4 *)(this + 0x50) = 0;
  if (((byte)this[100] & 1) == 0) {
    *(undefined4 *)(this + 0x58) = 1;
    return;
  }
  local_20 = 0xffff;
  local_60 = *(undefined4 *)(this + 0x3c);
  local_58 = *(float *)(this + 0x10) * *(float *)(this + 0x5c);
  local_50 = 0;
  local_4c = 100;
  local_48 = (CSoundPatch *)0x0;
  pcVar3 = *(char **)(this + 0x30);
  local_44 = 0.0;
  local_40 = 0;
  local_3c = 1;
  local_3b = 0;
  local_5c = "";
  if (pcVar3 != (char *)0x0) {
    local_5c = pcVar3;
  }
  local_3a = 0;
  local_38 = 0xffffffff;
  local_54 = *(undefined4 *)(this + 0x24);
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  uVar1 = *(uint *)(this + 0x38);
  local_28 = 0;
  local_24 = 0;
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) &&
     ((*(int *)(puVar4 + 4) != 0 &&
      ((iVar2 = *(int *)(*(int *)(puVar4 + 4) + 0x30), iVar2 == 0 ||
       (iVar2 - *(int *)(gpGlobals + 0x58) >> 4 == 0)))))) {
    local_48 = this + 0x44;
  }
  pcVar5 = "";
  if (pcVar3 != (char *)0x0) {
    pcVar5 = pcVar3;
  }
                    /* try { // try from 004bf0a3 to 004bf193 has its CatchHandler @ 004bf277 */
  iVar2 = V_stristr(pcVar5,"music");
  local_50 = *(uint *)(this + 0x54);
  if (iVar2 == 0) {
    local_50 = local_50 | 1;
  }
  local_3c = 0;
  local_4c = (int)*(float *)this;
  if (param_1 != 0.0) {
    local_44 = param_1;
  }
  uVar1 = *(uint *)(this + 0x38);
  iVar2 = -1;
  if (((uVar1 != 0xffffffff) &&
      (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar4 + 8) == uVar1 >> 0xc && (*(int *)(puVar4 + 4) != 0)))) {
    iVar2 = *(int *)(*(int *)(puVar4 + 4) + 0x30);
    if (iVar2 == 0) {
      iVar2 = 0;
    }
    else {
      iVar2 = iVar2 - *(int *)(gpGlobals + 0x58) >> 4;
    }
  }
  CBaseEntity::EmitSound((IRecipientFilter *)(this + 0x60),iVar2,(EmitSound_t *)&local_60);
  pcVar3 = *(char **)(this + 0x34);
  uVar1 = *(uint *)(this + 0x38);
  if (pcVar3 == (char *)0x0) {
    pcVar3 = "";
  }
  iVar2 = -1;
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
    iVar2 = *(int *)(*(int *)(puVar4 + 4) + 0x30);
    if (iVar2 == 0) {
      iVar2 = 0;
    }
    else {
      iVar2 = iVar2 - *(int *)(gpGlobals + 0x58) >> 4;
    }
  }
  CBaseEntity::EmitCloseCaption
            ((IRecipientFilter *)(this + 0x60),iVar2,pcVar3,(CUtlVector *)&local_34,
             *(float *)(this + 0x7c),true);
  local_28 = 0;
  CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
  local_24 = local_34;
  CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
  *(undefined4 *)(this + 0x58) = 1;
  return;
}

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)