L L4D2node

CSoundControllerImp::RestoreSoundPatch

0x004bea50 · 526 bytes · __thiscall

_ZN19CSoundControllerImp17RestoreSoundPatchEPP11CSoundPatchP8IRestore

Decompiled

undefined (3 params)

/* CSoundControllerImp::RestoreSoundPatch(CSoundPatch**, IRestore*) */

void __thiscall
CSoundControllerImp::RestoreSoundPatch
          (CSoundControllerImp *this,CSoundPatch **param_1,IRestore *param_2)

{
  undefined4 uVar1;
  int iVar2;
  SoundCommand_t *pSVar3;
  uint uVar4;
  CSoundPatch *local_28;
  int local_24;
  SoundCommand_t *local_20 [4];
  
  local_28 = (CSoundPatch *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)CSoundPatch::s_Allocator,0x80);
  *(undefined4 *)local_28 = 0;
  *(undefined4 *)(local_28 + 4) = 0;
  *(undefined4 *)(local_28 + 8) = 0;
  local_28[0xc] = (CSoundPatch)0x0;
  *(undefined4 *)(local_28 + 0x10) = 0;
  *(undefined4 *)(local_28 + 0x14) = 0;
  *(undefined4 *)(local_28 + 0x18) = 0;
  local_28[0x1c] = (CSoundPatch)0x0;
  uVar1 = soundpatch_captionlength._28_4_;
  *(undefined4 *)(local_28 + 0x38) = 0xffffffff;
  *(undefined ***)(local_28 + 0x60) = &PTR__CCopyRecipientFilter_00c1e5c8;
  *(undefined4 *)(local_28 + 100) = 0;
  *(undefined4 *)(local_28 + 0x68) = 0;
  *(undefined4 *)(local_28 + 0x6c) = 0;
  *(undefined4 *)(local_28 + 0x70) = 0;
  *(undefined4 *)(local_28 + 0x74) = 0;
  *(undefined4 *)(local_28 + 0x78) = 0;
  CSoundPatch::g_SoundPatchCount = CSoundPatch::g_SoundPatchCount + 1;
  *(undefined4 *)(local_28 + 0x30) = 0;
  *(undefined4 *)(local_28 + 0x34) = 0;
  uVar1 = *(undefined4 *)(uVar1 + 0x2c);
  *(undefined4 *)(local_28 + 0x44) = 0;
  *(undefined4 *)(local_28 + 0x7c) = uVar1;
  *(undefined4 *)(local_28 + 0x48) = 0;
  *(undefined4 *)(local_28 + 0x4c) = 0;
  *(undefined4 *)(local_28 + 0x40) = 0xffffffff;
  *(undefined4 *)(local_28 + 0x20) = 0xffffffff;
  (**(code **)(*(int *)param_2 + 0x1c))(param_2);
  iVar2 = (**(code **)(*(int *)param_2 + 8))(param_2,local_28,CSoundPatch::m_DataMap);
  (**(code **)(*(int *)param_2 + 0x20))(param_2);
  if ((iVar2 == 0) || (*(int *)(local_28 + 0x58) == 0)) {
    (**(code **)(*(int *)param_2 + 0x1c))(param_2);
  }
  else {
    CUtlVector<CSoundPatch*,CUtlMemory<CSoundPatch*,int>>::InsertBefore
              ((CUtlVector<CSoundPatch*,CUtlMemory<CSoundPatch*,int>> *)(this + 0x10),
               *(int *)(this + 0x1c),&local_28);
    (**(code **)(*(int *)param_2 + 0x1c))(param_2);
    (**(code **)(*(int *)param_2 + 0x38))(param_2,&local_24,1,0);
    while (local_24 = local_24 + -1, -1 < local_24) {
      pSVar3 = (SoundCommand_t *)
               CUtlMemoryPool::Alloc((CUtlMemoryPool *)SoundCommand_t::s_Allocator,0x18);
      uVar4 = 0;
      do {
        *(undefined4 *)(pSVar3 + uVar4) = 0;
        uVar4 = uVar4 + 4;
      } while (uVar4 < 0x18);
      (**(code **)(*(int *)param_2 + 0x1c))(param_2);
      iVar2 = (**(code **)(*(int *)param_2 + 8))(param_2,pSVar3,SoundCommand_t::m_DataMap);
      if (iVar2 != 0) {
        *(CSoundPatch **)pSVar3 = local_28;
        local_20[0] = pSVar3;
        CUtlPriorityQueue<SoundCommand_t*,CDefUtlPriorityQueueLessFunc<SoundCommand_t*>,CUtlMemory<SoundCommand_t*,int>>
        ::Insert((CUtlPriorityQueue<SoundCommand_t*,CDefUtlPriorityQueueLessFunc<SoundCommand_t*>,CUtlMemory<SoundCommand_t*,int>>
                  *)(this + 0x24),local_20);
      }
      (**(code **)(*(int *)param_2 + 0x20))(param_2);
    }
  }
  (**(code **)(*(int *)param_2 + 0x20))(param_2);
  *param_1 = local_28;
  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)