CBreakable::DamageSound
0x006b3a10 · 804 bytes · __thiscall
_ZN10CBreakable11DamageSoundEv
Decompiled
undefined (1 param)
/* CBreakable::DamageSound() */
void __thiscall CBreakable::DamageSound(CBreakable *this)
{
char cVar1;
int iVar2;
undefined1 *puVar3;
int iVar4;
uint uVar5;
int in_GS_OFFSET;
longdouble lVar6;
undefined **local_12c [8];
undefined4 local_10c;
undefined1 *local_108;
float local_104;
undefined4 local_100;
undefined4 local_fc;
int local_f8;
undefined4 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;
undefined4 local_c4;
undefined4 local_c0;
undefined4 local_bc;
undefined4 local_b8;
undefined4 local_b4;
undefined1 local_b0;
undefined4 local_ac;
undefined1 local_a8 [128];
undefined4 local_28;
undefined4 local_24;
int local_20;
iVar4 = 100;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
uVar5 = *(uint *)(this + 0x44c);
iVar2 = (**(code **)(*random_valve + 8))();
if (iVar2 == 0) {
iVar4 = (**(code **)(*random_valve + 8))();
iVar4 = iVar4 + 0x5f;
}
lVar6 = (longdouble)(**(code **)(*random_valve + 4))();
if (uVar5 == 6) {
iVar2 = (**(code **)(*random_valve + 8))();
uVar5 = (-(uint)(iVar2 == 0) & 4) + 2;
}
else {
puVar3 = &stack0xfffffec4;
if (8 < uVar5) goto LAB_006b3a87;
}
puVar3 = &stack0xfffffec4;
if (*(char **)(CSWTCH_2000 + uVar5 * 4) != (char *)0x0) {
local_c8 = 0;
local_c4 = 0x3f800000;
local_c0 = 100;
local_bc = 100;
local_b8 = 100;
local_b4 = 0x4b;
local_a8[0] = 0;
local_b0 = 0;
local_ac = 0;
local_28 = 0;
local_24 = 0;
cVar1 = CBaseEntity::GetParametersForSound
(*(char **)(CSWTCH_2000 + uVar5 * 4),(CSoundParameters *)&local_c8,(char *)0x0
);
puVar3 = &stack0xfffffec4;
if (cVar1 != '\0') {
(**(code **)(*(int *)this + 0x28c))();
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_12c);
local_12c[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 006b3b94 to 006b3b98 has its CatchHandler @ 006b3d6a */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_12c,(Vector *)&local_10c);
local_12c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 006b3bb2 to 006b3bd4 has its CatchHandler @ 006b3d3c */
(**(code **)(*(int *)this + 0x28c))();
puVar3 = &stack0xfffffebc;
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_12c,(Vector *)&local_10c,0.8);
local_cc = 0xffff;
local_fc = 0;
local_f4 = 0;
local_f0 = 0;
local_10c = local_c8;
local_108 = local_a8;
local_ec = 0;
local_e8 = 1;
local_e7 = 0;
local_100 = local_b4;
local_e6 = 0;
local_e4 = 0xffffffff;
local_e0 = 0;
local_dc = 0;
local_d8 = 0;
local_d4 = 0;
local_d0 = 0;
if (*(int *)(this + 0x30) == 0) {
iVar2 = 0;
}
else {
iVar2 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
local_104 = (float)lVar6;
local_f8 = iVar4;
/* try { // try from 006b3cbc to 006b3cc0 has its CatchHandler @ 006b3d58 */
CBaseEntity::EmitSound((IRecipientFilter *)local_12c,iVar2,(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);
}
}
LAB_006b3a87:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined1 **)(puVar3 + -4) = &LAB_006b3d3c;
__stack_chk_fail();
}
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.