L L4D2node

CBaseEntity::StopSound

0x004b2640 · 290 bytes · __thiscall

_ZN11CBaseEntity9StopSoundEPKcRs

Decompiled

undefined (3 params)

/* CBaseEntity::StopSound(char const*, short&) */

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

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