CBaseEntity::EmitSound
0x004b4d10 · 926 bytes · __thiscall
_ZN11CBaseEntity9EmitSoundEPKcRsfPf
Decompiled
undefined (5 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseEntity::EmitSound(char const*, short&, float, float*) */
void __thiscall
CBaseEntity::EmitSound(CBaseEntity *this,char *param_1,short *param_2,float param_3,float *param_4)
{
uint *puVar1;
undefined1 uVar2;
char cVar3;
int iVar4;
int iVar5;
float local_b0;
undefined4 local_a4;
undefined4 local_a0;
undefined4 local_98;
undefined4 local_94;
int local_90;
Vector local_8c [12];
undefined **local_80 [8];
undefined4 local_60;
char *local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
float local_44;
float *local_40;
undefined1 local_3c;
undefined1 local_3b;
undefined1 local_3a;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined2 local_20;
local_a4 = 0;
local_a0 = 0;
if (_towlower == 0) {
local_90 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_a4,0,0,0,0,
"/data/src/game/server/../../game/shared/soundemittersystem.cpp",0x658,
&EmitSound(char_const*,short&,float,float*)::tm_fmt,"(%s)%s","CBaseEntity::EmitSound"
,"CBaseEntity::EmitSound");
local_90 = _towlower;
}
iVar4 = _DAT_0105db00;
local_98 = local_a4;
local_94 = local_a0;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 004b5036 to 004b5096 has its CatchHandler @ 004b5119 */
iVar5 = ThreadGetCurrentId();
if (iVar4 == iVar5) {
if ((char *)*_DAT_0105d15c != "CBaseEntity::EmitSound") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc1d7c1,(char *)0x0,0xc1d7c1);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
uVar2 = s_bAbsQueriesValid;
s_bAbsQueriesValid = 1;
/* try { // try from 004b4e02 to 004b4e15 has its CatchHandler @ 004b511d */
(**(code **)(*(int *)this + 0x28c))(local_8c,this);
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
local_80[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 004b4e24 to 004b4e28 has its CatchHandler @ 004b50bf */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,local_8c);
local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 004b4e48 to 004b4eac has its CatchHandler @ 004b5122 */
iVar4 = (**(code **)(*soundemitterbase + 0xa8))(soundemitterbase,param_1,param_2);
local_b0 = 4.0;
if (0x32 < iVar4) {
local_b0 = 20.0 / (float)(iVar4 + -0x32);
}
(**(code **)(*(int *)this + 0x28c))((Vector *)&local_60,this);
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,local_b0);
local_60 = 0;
local_58 = 0x3f800000;
local_54 = 0;
local_50 = 0;
local_5c = param_1;
local_4c = 100;
local_48 = 0;
local_3c = 1;
local_40 = param_4;
local_3b = 0;
local_38 = 0xffffffff;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0xffff;
local_44 = param_3;
local_3a = 1;
if (*(int *)(this + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
/* try { // try from 004b4f55 to 004b4f59 has its CatchHandler @ 004b50f9 */
EmitSound((IRecipientFilter *)local_80,iVar4,(EmitSound_t *)&local_60,param_2);
local_28 = 0;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
local_24 = local_34;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
local_80[0] = &PTR__CPASFilter_00bfaf28;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
iVar4 = _DAT_0105db00;
s_bAbsQueriesValid = uVar2;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar5 = ThreadGetCurrentId();
if (iVar4 == iVar5) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_90 != 0) {
(**(code **)(local_90 + 0x54))(local_90,local_98,local_94,0,0,0);
}
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.