L L4D2node

CSoundEnt::FreeSound

0x0082c540 · 191 bytes · __cdecl

_ZN9CSoundEnt9FreeSoundEi

Decompiled

undefined (1 param)

/* CSoundEnt::FreeSound(int) */

void CSoundEnt::FreeSound(int param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  iVar2 = g_pSoundEnt;
  if ((g_pSoundEnt == 0) || (param_1 == -1)) {
    return;
  }
  iVar3 = *(int *)(g_pSoundEnt + 0x444);
  if (iVar3 == -1) {
LAB_0082c590:
    Warning("Attempted to free unknown sound %d!\n",param_1);
    return;
  }
  if (param_1 != iVar3) {
    do {
      iVar4 = iVar3;
      iVar1 = g_pSoundEnt + 0x450 + iVar4 * 0x34;
      iVar3 = (int)*(short *)(iVar1 + 0x18);
      if (iVar3 == -1) goto LAB_0082c590;
    } while (param_1 != iVar3);
    if (iVar4 != -1) {
      *(undefined2 *)(iVar1 + 0x18) = *(undefined2 *)(g_pSoundEnt + 0x468 + param_1 * 0x34);
      goto LAB_0082c5cb;
    }
  }
  *(int *)(g_pSoundEnt + 0x444) = (int)*(short *)(g_pSoundEnt + 0x468 + param_1 * 0x34);
LAB_0082c5cb:
  *(short *)(iVar2 + 0x468 + param_1 * 0x34) = (short)*(undefined4 *)(iVar2 + 0x440);
  *(int *)(iVar2 + 0x440) = param_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)