L L4D2node

CBaseEntity::StopSound

0x004b2780 · 225 bytes · __cdecl

_ZN11CBaseEntity9StopSoundEiPKc

Decompiled

undefined (2 params)

/* CBaseEntity::StopSound(int, char const*) */

void CBaseEntity::StopSound(int param_1,char *param_2)

{
  short sVar1;
  undefined4 *puVar2;
  uint uVar3;
  undefined4 uVar4;
  ushort uVar5;
  undefined4 *puVar6;
  int iVar7;
  
  sVar1 = (**(code **)(*soundemitterbase + 0x1c))(soundemitterbase,param_2);
  if (((sVar1 != -1) &&
      (puVar2 = (undefined4 *)(**(code **)(*soundemitterbase + 0x58))(soundemitterbase,(int)sVar1),
      puVar2 != (undefined4 *)0x0)) && (uVar5 = *(ushort *)(puVar2 + 2), uVar5 != 0)) {
    uVar3 = (uint)uVar5;
    iVar7 = 0;
    while( true ) {
      puVar6 = puVar2;
      if (uVar5 != 1) {
        puVar6 = (undefined4 *)*puVar2;
      }
      uVar4 = (**(code **)(*soundemitterbase + 0x30))(soundemitterbase,puVar6 + iVar7);
      (**(code **)(*enginesound + 0x20))
                (enginesound,param_1,*(undefined2 *)((int)puVar2 + 0x16),uVar4);
      (**(code **)(g_SoundEmitterSystem + 0x44))
                (&g_SoundEmitterSystem,param_1,"StopSound:  \'%s\' stopped as \'%s\' (ent %i)\n",
                 param_2,uVar4,param_1);
      if (iVar7 == uVar3 - 1) break;
      uVar5 = *(ushort *)(puVar2 + 2);
      iVar7 = iVar7 + 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)