L L4D2node

CSoundPatch::ResumeSound

0x004bed50 · 451 bytes · __thiscall

_ZN11CSoundPatch11ResumeSoundEv

Decompiled

undefined (1 param)

/* CSoundPatch::ResumeSound() */

void __thiscall CSoundPatch::ResumeSound(CSoundPatch *this)

{
  uint uVar1;
  uint uVar2;
  undefined1 *puVar3;
  undefined *puVar4;
  int iVar5;
  int local_70;
  undefined4 local_60;
  undefined1 *local_5c;
  float local_58;
  undefined4 local_54;
  uint local_50;
  int local_4c;
  CSoundPatch *local_48;
  undefined4 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;
  
  if ((*(int *)(this + 0x58) == 0) || (((byte)this[100] & 1) == 0)) {
    return;
  }
  uVar1 = *(uint *)(this + 0x38);
  if (((((uVar1 == 0xffffffff) ||
        (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
       (uVar2 = *(uint *)(puVar4 + 8), uVar2 != uVar1 >> 0xc)) || (*(int *)(puVar4 + 4) == 0)) ||
     ((iVar5 = *(int *)(*(int *)(puVar4 + 4) + 0x30), iVar5 != 0 &&
      (iVar5 - *(int *)(gpGlobals + 0x58) < -0xf)))) {
    puVar3 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x30) != (undefined1 *)0x0) {
      puVar3 = *(undefined1 **)(this + 0x30);
    }
    DevWarning("CSoundPatch::ResumeSound: Lost EHAndle on restore - destroy the sound patch in your entity\'s StopLoopingSounds! (%s)\n"
               ,puVar3);
    return;
  }
  local_48 = (CSoundPatch *)0x0;
  local_20 = 0xffff;
  local_60 = *(undefined4 *)(this + 0x3c);
  local_44 = 0;
  local_40 = 0;
  local_58 = *(float *)(this + 0x10) * *(float *)(this + 0x5c);
  local_3c = 1;
  local_5c = &DAT_00d539c2;
  if (*(undefined1 **)(this + 0x30) != (undefined1 *)0x0) {
    local_5c = *(undefined1 **)(this + 0x30);
  }
  local_3b = 0;
  local_3a = 0;
  local_54 = *(undefined4 *)(this + 0x24);
  local_38 = 0xffffffff;
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_50 = *(uint *)(this + 0x54) | 3;
  local_24 = 0;
  local_4c = (int)*(float *)this;
  if ((uVar2 == *(uint *)(puVar4 + 8)) && (local_70 = *(int *)(puVar4 + 4), local_70 != 0)) {
    if ((*(int *)(local_70 + 0x30) == 0) ||
       (*(int *)(local_70 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 == 0)) {
      local_48 = this + 0x44;
      if (uVar2 != *(uint *)(puVar4 + 8)) goto LAB_004bee74;
      local_70 = *(int *)(puVar4 + 4);
    }
    if (local_70 != 0) {
      if (*(int *)(local_70 + 0x30) == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(local_70 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      goto LAB_004bee79;
    }
  }
LAB_004bee74:
  iVar5 = -1;
LAB_004bee79:
                    /* try { // try from 004bee8a to 004bee8e has its CatchHandler @ 004bef27 */
  CBaseEntity::EmitSound((IRecipientFilter *)(this + 0x60),iVar5,(EmitSound_t *)&local_60);
  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);
  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)