PlayLockSounds
0x00669980 · 1474 bytes · __cdecl
_Z14PlayLockSoundsP11CBaseEntityP11locksound_tii
Decompiled
undefined (4 params)
/* PlayLockSounds(CBaseEntity*, locksound_t*, int, int) */
void PlayLockSounds(CBaseEntity *param_1,locksound_t *param_2,int param_3,int param_4)
{
bool bVar1;
int iVar2;
int iVar3;
undefined1 *puVar4;
undefined4 *puVar5;
undefined4 *puVar6;
int iVar7;
undefined4 local_a0;
float local_90;
undefined **local_80 [8];
undefined4 local_60;
undefined1 *local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 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;
puVar6 = (undefined4 *)&stack0xffffff34;
puVar5 = (undefined4 *)&stack0xffffff34;
if ((*(uint *)(param_1 + 0x148) & 0x1000) != 0) {
return;
}
local_90 = 1.0;
if (param_4 != 0) {
local_90 = 0.5;
}
if (param_3 == 0) {
if (*(int *)(param_2 + 0xc) == 0) {
bVar1 = false;
}
else {
bVar1 = *(float *)(param_2 + 0x1c) <= *(float *)(gpGlobals + 0xc) &&
*(float *)(gpGlobals + 0xc) != *(float *)(param_2 + 0x1c);
}
if (((*(int *)(param_2 + 0x10) == 0) || (param_2[0x25] != (locksound_t)0x0)) ||
(*(float *)(gpGlobals + 0xc) < *(float *)(param_2 + 0x20) ||
*(float *)(gpGlobals + 0xc) == *(float *)(param_2 + 0x20))) {
if (!bVar1) {
return;
}
bVar1 = false;
local_a0 = 0x3f800000;
}
else {
if (!bVar1) {
iVar7 = *(int *)(param_2 + 0x18);
puVar4 = *(undefined1 **)(param_2 + 0x10);
goto LAB_00669e70;
}
bVar1 = true;
local_a0 = 0x3e800000;
}
(**(code **)(*(int *)param_1 + 0x28c))();
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
local_80[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 00669d05 to 00669d09 has its CatchHandler @ 00669f93 */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 00669d20 to 00669d48 has its CatchHandler @ 00669f91 */
(**(code **)(*(int *)param_1 + 0x28c))();
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
local_50 = 0;
local_20 = 0xffff;
local_4c = 100;
local_48 = 0;
local_44 = 0;
local_5c = &DAT_00d539c2;
if (*(undefined1 **)(param_2 + 0xc) != (undefined1 *)0x0) {
local_5c = *(undefined1 **)(param_2 + 0xc);
}
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 = 3;
local_58 = local_a0;
local_54 = 0x4b;
iVar7 = 0;
if (*(int *)(param_1 + 0x30) != 0) {
iVar7 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
/* try { // try from 00669e02 to 00669e06 has its CatchHandler @ 00669f8f */
CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar7,(EmitSound_t *)&local_60);
local_28 = 0;
*(float *)(param_2 + 0x1c) = local_90 + *(float *)(gpGlobals + 0xc);
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);
if (!bVar1) {
return;
}
iVar7 = *(int *)(param_2 + 0x18);
puVar4 = &DAT_00d539c2;
puVar6 = (undefined4 *)&stack0xffffff2c;
if (*(undefined1 **)(param_2 + 0x10) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(param_2 + 0x10);
puVar6 = (undefined4 *)&stack0xffffff2c;
}
LAB_00669e70:
puVar6[6] = iVar7;
puVar6[7] = 0;
puVar6[5] = 100;
puVar6[4] = 0;
puVar6[3] = 0x4b;
puVar6[2] = 0x3f59999a;
puVar6[1] = puVar4;
*puVar6 = *(undefined4 *)(param_1 + 0x30);
puVar6[-1] = 0x669eab;
iVar3 = SENTENCEG_PlaySequentialSz();
*(undefined4 *)(param_2 + 0x14) = 0;
*(int *)(param_2 + 0x18) = iVar3;
iVar2 = gpGlobals;
param_2[0x25] = (locksound_t)(iVar7 == iVar3);
*(float *)(param_2 + 0x20) = *(float *)(iVar2 + 0xc) + 6.0;
return;
}
if (*(int *)(param_2 + 4) == 0) {
bVar1 = false;
}
else {
bVar1 = *(float *)(param_2 + 0x1c) <= *(float *)(gpGlobals + 0xc) &&
*(float *)(gpGlobals + 0xc) != *(float *)(param_2 + 0x1c);
}
if (((*(int *)(param_2 + 8) == 0) || (param_2[0x24] != (locksound_t)0x0)) ||
(*(float *)(gpGlobals + 0xc) < *(float *)(param_2 + 0x20) ||
*(float *)(gpGlobals + 0xc) == *(float *)(param_2 + 0x20))) {
if (!bVar1) {
return;
}
bVar1 = false;
local_a0 = 0x3f800000;
}
else {
if (!bVar1) {
iVar7 = *(int *)(param_2 + 0x14);
puVar4 = *(undefined1 **)(param_2 + 8);
goto LAB_00669bea;
}
bVar1 = true;
local_a0 = 0x3e800000;
}
(**(code **)(*(int *)param_1 + 0x28c))();
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
local_80[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 00669a83 to 00669a87 has its CatchHandler @ 00669f66 */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 00669a9e to 00669ac6 has its CatchHandler @ 00669f47 */
(**(code **)(*(int *)param_1 + 0x28c))();
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
local_50 = 0;
local_20 = 0xffff;
local_4c = 100;
local_48 = 0;
local_44 = 0;
local_5c = &DAT_00d539c2;
if (*(undefined1 **)(param_2 + 4) != (undefined1 *)0x0) {
local_5c = *(undefined1 **)(param_2 + 4);
}
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 = 3;
local_58 = local_a0;
local_54 = 0x4b;
iVar7 = 0;
if (*(int *)(param_1 + 0x30) != 0) {
iVar7 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
/* try { // try from 00669b80 to 00669b84 has its CatchHandler @ 00669f6a */
CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar7,(EmitSound_t *)&local_60);
local_28 = 0;
*(float *)(param_2 + 0x1c) = local_90 + *(float *)(gpGlobals + 0xc);
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);
if (!bVar1) {
return;
}
iVar7 = *(int *)(param_2 + 0x14);
puVar4 = &DAT_00d539c2;
puVar5 = (undefined4 *)&stack0xffffff2c;
if (*(undefined1 **)(param_2 + 8) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(param_2 + 8);
puVar5 = (undefined4 *)&stack0xffffff2c;
}
LAB_00669bea:
puVar5[7] = 0;
puVar5[6] = iVar7;
puVar5[5] = 100;
puVar5[4] = 0;
puVar5[3] = 0x4b;
puVar5[2] = 0x3f59999a;
puVar5[1] = puVar4;
*puVar5 = *(undefined4 *)(param_1 + 0x30);
puVar5[-1] = 0x669c25;
iVar3 = SENTENCEG_PlaySequentialSz();
*(undefined4 *)(param_2 + 0x18) = 0;
*(int *)(param_2 + 0x14) = iVar3;
iVar2 = gpGlobals;
param_2[0x24] = (locksound_t)(iVar7 == iVar3);
*(float *)(param_2 + 0x20) = *(float *)(iVar2 + 0xc) + 6.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.