L L4D2node

CBaseEntity::StopSound

0x004b2530 · 258 bytes · __thiscall

_ZN11CBaseEntity9StopSoundEPKc

Decompiled

undefined (2 params)

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

void __thiscall CBaseEntity::StopSound(CBaseEntity *this,char *param_1)

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