CBaseEntity::StopSound
0x004b2870 · 364 bytes · __cdecl
_ZN11CBaseEntity9StopSoundEiiPKc
Decompiled
undefined (3 params)
/* CBaseEntity::StopSound(int, int, char const*) */
void CBaseEntity::StopSound(int param_1,int param_2,char *param_3)
{
short sVar1;
int iVar2;
undefined4 *puVar3;
uint uVar4;
undefined4 uVar5;
ushort uVar6;
undefined4 *puVar7;
if ((param_3 == (char *)0x0) ||
(((iVar2 = V_stristr(param_3,".wav"), iVar2 == 0 &&
(iVar2 = V_stristr(param_3,".mp3"), iVar2 == 0)) && (*param_3 != '!')))) {
sVar1 = (**(code **)(*soundemitterbase + 0x1c))(soundemitterbase,param_3);
if (((sVar1 != -1) &&
(puVar3 = (undefined4 *)(**(code **)(*soundemitterbase + 0x58))(soundemitterbase,(int)sVar1)
, puVar3 != (undefined4 *)0x0)) && (uVar6 = *(ushort *)(puVar3 + 2), uVar6 != 0)) {
uVar4 = (uint)uVar6;
iVar2 = 0;
while( true ) {
puVar7 = puVar3;
if (uVar6 != 1) {
puVar7 = (undefined4 *)*puVar3;
}
uVar5 = (**(code **)(*soundemitterbase + 0x30))(soundemitterbase,puVar7 + iVar2);
(**(code **)(*enginesound + 0x20))
(enginesound,param_1,*(undefined2 *)((int)puVar3 + 0x16),uVar5);
(**(code **)(g_SoundEmitterSystem + 0x44))
(&g_SoundEmitterSystem,param_1,"StopSound: \'%s\' stopped as \'%s\' (ent %i)\n",
param_3,uVar5,param_1);
if (iVar2 == uVar4 - 1) break;
iVar2 = iVar2 + 1;
uVar6 = *(ushort *)(puVar3 + 2);
}
}
}
else {
(**(code **)(*enginesound + 0x20))(enginesound,param_1,param_2,param_3);
(**(code **)(g_SoundEmitterSystem + 0x44))
(&g_SoundEmitterSystem,param_1,"StopSound: Raw wave stopped \'%s\' (ent %i)\n",
param_3,param_1);
}
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.