CBasePlayer::PlayStepSound
0x0041ac10 · 746 bytes · __cdecl
_ZN11CBasePlayer13PlayStepSoundER6VectorP13surfacedata_tfb
Decompiled
undefined (4 params)
/* CBasePlayer::PlayStepSound(Vector&, surfacedata_t*, float, bool) */
void CBasePlayer::PlayStepSound(Vector *param_1,surfacedata_t *param_2,float param_3,bool param_4)
{
char cVar1;
int *piVar2;
char *pcVar3;
int iVar4;
int iVar5;
CSoundParameters *pCVar6;
Vector *pVVar7;
short sVar8;
undefined4 *puVar9;
int in_GS_OFFSET;
byte bVar10;
undefined3 in_stack_00000011;
CRecipientFilter local_12c [32];
undefined4 local_10c;
undefined1 *local_108;
undefined4 local_104;
undefined4 local_100;
undefined4 local_fc;
undefined4 local_f8;
surfacedata_t *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 [6];
undefined1 local_b0;
int local_ac;
undefined1 local_a8 [128];
undefined4 local_28;
undefined4 local_24;
int local_20;
bVar10 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((*(int *)(gpGlobals + 0x14) < 2) || (*(float *)(sv_footsteps._28_4_ + 0x2c) != 0.0)) &&
(param_3 != 0.0)) {
iVar4 = *(int *)(param_1 + 0x1aa0);
sVar8 = *(short *)((int)param_3 + 0x32);
if (iVar4 != 0) {
sVar8 = *(short *)((int)param_3 + 0x30);
}
if (sVar8 != 0) {
local_c8[0] = 0;
local_c8[1] = 0x3f800000;
*(uint *)(param_1 + 0x1aa0) = (uint)(iVar4 == 0);
local_c8[2] = 100;
local_c8[3] = 100;
local_c8[4] = 100;
local_c8[5] = 0x4b;
local_a8[0] = 0;
local_b0 = 0;
local_ac = 0;
local_28 = 0;
local_24 = 0;
if (sVar8 == *(short *)(param_1 + iVar4 * 0xac + 0x2238)) {
pVVar7 = param_1 + iVar4 * 0xac + 0x2190;
puVar9 = local_c8;
for (iVar5 = 0x2a; iVar5 != 0; iVar5 = iVar5 + -1) {
*puVar9 = *(undefined4 *)pVVar7;
pVVar7 = pVVar7 + 4;
puVar9 = puVar9 + 1;
}
}
else {
piVar2 = (int *)(**(code **)(*IMoveHelper::sm_pSingleton + 0x30))
(IMoveHelper::sm_pSingleton);
pcVar3 = (char *)(**(code **)(*piVar2 + 0x1c))(piVar2,sVar8);
cVar1 = CBaseEntity::GetParametersForSound(pcVar3,(CSoundParameters *)local_c8,(char *)0x0);
if (cVar1 == '\0') goto LAB_0041ac4f;
if (local_ac == 1) {
*(short *)(param_1 + iVar4 * 0xac + 0x2238) = sVar8;
pCVar6 = (CSoundParameters *)local_c8;
pVVar7 = param_1 + iVar4 * 0xac + 0x2190;
for (iVar5 = 0x2a; iVar5 != 0; iVar5 = iVar5 + -1) {
*(undefined4 *)pVVar7 = *(undefined4 *)pCVar6;
pCVar6 = pCVar6 + (uint)bVar10 * -8 + 4;
pVVar7 = pVVar7 + (uint)bVar10 * -8 + 4;
}
}
}
CRecipientFilter::CRecipientFilter(local_12c);
/* try { // try from 0041adb6 to 0041add7 has its CatchHandler @ 0041af09 */
CRecipientFilter::AddRecipientsByPAS(local_12c,(Vector *)param_2);
if (1 < *(int *)(gpGlobals + 0x14)) {
CRecipientFilter::RemoveRecipientsByPVS(local_12c,(Vector *)param_2);
}
local_fc = 0;
local_cc = 0xffff;
local_108 = local_a8;
local_f0 = 0;
local_ec = 0;
local_e8 = 1;
local_100 = local_c8[5];
local_e7 = 0;
local_e6 = 0;
local_e4 = 0xffffffff;
local_f8 = local_c8[2];
local_e0 = 0;
local_dc = 0;
local_d8 = 0;
local_f4 = param_2;
local_d4 = 0;
local_d0 = 0;
local_10c = 4;
local_104 = _param_4;
if (*(int *)(param_1 + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
/* try { // try from 0041aebe to 0041aec2 has its CatchHandler @ 0041af1b */
CBaseEntity::EmitSound((IRecipientFilter *)local_12c,iVar4,(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);
CRecipientFilter::~CRecipientFilter(local_12c);
}
}
LAB_0041ac4f:
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.