physicssound::PlayImpactSounds
0x0077eb20 · 899 bytes · __cdecl
_ZN12physicssound16PlayImpactSoundsERNS_11soundlist_tE
Decompiled
undefined (1 param)
/* physicssound::PlayImpactSounds(physicssound::soundlist_t&) */
void physicssound::PlayImpactSounds(soundlist_t *param_1)
{
Vector *pVVar1;
short sVar2;
short sVar3;
char cVar4;
int iVar5;
int iVar6;
char *pcVar7;
short sVar8;
int iVar9;
int iVar10;
int in_GS_OFFSET;
float fVar11;
int local_130;
undefined **local_12c [8];
undefined4 local_10c;
undefined1 *local_108;
float local_104;
int local_100;
undefined4 local_fc;
undefined4 local_f8;
Vector *local_f4;
undefined4 local_f0;
undefined4 local_ec;
undefined1 local_e8;
undefined1 local_e7;
undefined1 local_e6;
undefined4 local_e4;
undefined4 local_e0;
undefined4 local_dc;
undefined4 local_d8;
undefined4 local_d4;
undefined4 local_d0;
undefined2 local_cc;
undefined4 local_c8;
float local_c4;
undefined4 local_c0;
undefined4 local_bc;
undefined4 local_b8;
int local_b4;
undefined1 local_b0;
undefined4 local_ac;
undefined1 local_a8 [128];
undefined4 local_28;
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_130 = *(int *)(param_1 + 0xc) + -1;
if (-1 < local_130) {
iVar10 = local_130 * 0x24;
do {
iVar9 = *(int *)param_1 + iVar10;
iVar5 = (**(code **)(*physprops + 0x18))(physprops,*(undefined2 *)(iVar9 + 0x14));
if (*(short *)(iVar5 + 0x36) != 0) {
iVar6 = (**(code **)(*physprops + 0x18))(physprops,*(undefined2 *)(iVar9 + 0x16));
sVar2 = *(short *)(iVar5 + 0x36);
sVar8 = sVar2;
if ((((iVar6 != 0) && (sVar3 = *(short *)(iVar5 + 0x34), sVar3 != 0)) &&
(sVar8 = sVar3,
*(float *)(iVar5 + 0x24) < *(float *)(iVar6 + 0x18) ||
*(float *)(iVar5 + 0x24) == *(float *)(iVar6 + 0x18))) &&
((fVar11 = *(float *)(iVar5 + 0x28), sVar8 = sVar2, 0.0 < fVar11 &&
(*(float *)(iVar9 + 0x10) <= fVar11 && fVar11 != *(float *)(iVar9 + 0x10))))) {
sVar8 = sVar3;
}
pcVar7 = (char *)(**(code **)(*physprops + 0x1c))(physprops,sVar8);
local_a8[0] = 0;
local_c8 = 0;
local_c4 = 1.0;
local_c0 = 100;
local_bc = 100;
local_b8 = 100;
local_b4 = 0x4b;
local_b0 = 0;
local_ac = 0;
local_28 = 0;
local_24 = 0;
cVar4 = CBaseEntity::GetParametersForSound(pcVar7,(CSoundParameters *)&local_c8,(char *)0x0)
;
iVar5 = local_b4;
if (cVar4 == '\0') break;
if (1.0 < *(float *)(iVar9 + 0xc)) {
*(undefined4 *)(iVar9 + 0xc) = 0x3f800000;
}
pVVar1 = (Vector *)(iVar9 + 0x18);
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_12c);
local_12c[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 0077ecd4 to 0077ecd8 has its CatchHandler @ 0077eea4 */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_12c,pVVar1);
local_12c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
fVar11 = 4.0;
if (0x32 < iVar5) {
fVar11 = 20.0 / (float)(iVar5 + -0x32);
}
/* try { // try from 0077ed20 to 0077ed24 has its CatchHandler @ 0077ef03 */
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_12c,pVVar1,fVar11);
local_fc = 0;
local_f0 = 0;
local_ec = 0;
local_e8 = 1;
local_e7 = 0;
local_e6 = 0;
local_e4 = 0xffffffff;
local_e0 = 0;
local_dc = 0;
local_d8 = 0;
local_d4 = 0;
local_d0 = 0;
local_cc = 0xffff;
local_10c = *(undefined4 *)(iVar9 + 8);
local_104 = *(float *)(iVar9 + 0xc) * local_c4;
local_108 = local_a8;
local_100 = local_b4;
local_f8 = local_c0;
local_f4 = pVVar1;
/* try { // try from 0077ee2b to 0077ee2f has its CatchHandler @ 0077eebb */
CBaseEntity::EmitSound((IRecipientFilter *)local_12c,0,(EmitSound_t *)&local_10c);
local_d4 = 0;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_e0);
local_d0 = local_e0;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_e0);
local_12c[0] = &PTR__CPASFilter_00bfaf28;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_12c);
}
local_130 = local_130 + -1;
iVar10 = iVar10 + -0x24;
} while (local_130 != -1);
}
*(undefined4 *)(param_1 + 0xc) = 0;
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.