UTIL_EmitSoundSuit
0x0082bac0 · 695 bytes · __cdecl
_Z18UTIL_EmitSoundSuitP7edict_tPKc
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* UTIL_EmitSoundSuit(edict_t*, char const*) */
void UTIL_EmitSoundSuit(edict_t *param_1,char *param_2)
{
int *piVar1;
int iVar2;
undefined *puVar3;
int iVar4;
int *local_98;
int local_94;
float local_90;
undefined **local_80 [8];
undefined4 local_60;
char *local_5c;
float local_58;
undefined4 local_54;
undefined4 local_50;
int local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 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_90 = *(float *)(suitvolume._28_4_ + 0x2c);
iVar2 = (**(code **)(*random_valve + 8))(random_valve,0,1);
local_94 = 100;
if (iVar2 != 0) {
local_94 = (**(code **)(*random_valve + 8))(random_valve,0,6);
local_94 = local_94 + 0x62;
}
if (param_1 == (edict_t *)0x0) {
iVar2 = 0;
}
else {
piVar1 = *(int **)(param_1 + 0xc);
iVar2 = 0;
if (piVar1 != (int *)0x0) {
iVar2 = (**(code **)(*piVar1 + 0x18))(piVar1);
}
}
if (*(float *)(gpGlobals + 0xc) <= g_AIFriendliesTalkSemaphore) {
iVar4 = 0;
if (((_DAT_00fbc734 != 0xffffffff) &&
(puVar3 = g_pEntityList + (_DAT_00fbc734 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc)
) && (*(uint *)(puVar3 + 8) == _DAT_00fbc734 >> 0xc)) {
iVar4 = *(int *)(puVar3 + 4);
}
if (iVar2 != iVar4) {
local_90 = local_90 * 0.3;
}
}
if (0.05 < local_90) {
if ((param_1 == (edict_t *)0x0) || (piVar1 = *(int **)(param_1 + 0xc), piVar1 == (int *)0x0)) {
local_98 = (int *)0x0;
}
else {
local_98 = (int *)(**(code **)(*piVar1 + 0x18))(piVar1);
}
(**(code **)(*local_98 + 0x28c))((Vector *)&local_60,local_98);
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
local_80[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 0082bc03 to 0082bc07 has its CatchHandler @ 0082bdc0 */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 0082bc1e to 0082bc3a has its CatchHandler @ 0082bdd2 */
(**(code **)(*local_98 + 0x28c))((Vector *)&local_60,local_98);
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
/* try { // try from 0082bc3e to 0082bc42 has its CatchHandler @ 0082bdd6 */
CRecipientFilter::MakeReliable((CRecipientFilter *)local_80);
local_20 = 0xffff;
local_50 = 0;
local_48 = 0;
local_44 = 0;
local_5c = param_2;
local_40 = 0;
local_3c = 1;
local_3b = 0;
local_3a = 0;
local_38 = 0xffffffff;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_60 = 6;
local_58 = local_90;
local_54 = 0x4b;
if (param_1 == (edict_t *)0x0) {
iVar2 = 0;
}
else {
iVar2 = (int)param_1 - *(int *)(gpGlobals + 0x58) >> 4;
}
local_4c = local_94;
/* try { // try from 0082bce8 to 0082bcec has its CatchHandler @ 0082bd87 */
CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar2,(EmitSound_t *)&local_60);
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);
}
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.