CBasePlayer::UpdatePlayerSound
0x007aef00 · 385 bytes · __thiscall
_ZN11CBasePlayer17UpdatePlayerSoundEv
Decompiled
undefined (1 param)
/* CBasePlayer::UpdatePlayerSound() */
void __thiscall CBasePlayer::UpdatePlayerSound(CBasePlayer *this)
{
undefined4 uVar1;
int iVar2;
int iVar3;
int iVar4;
byte bVar5;
int iVar6;
iVar3 = CSoundEnt::ClientSoundIndex(*(edict_t **)(this + 0x30));
iVar3 = CSoundEnt::SoundPointerForIndex(iVar3);
if (iVar3 == 0) {
Msg();
return;
}
if ((*(uint *)(this + 0x150) & 0x8000) == 0) {
bVar5 = (byte)(*(uint *)(this + 0x14c) >> 8);
if ((*(uint *)(this + 0x150) & 1) == 0) {
iVar6 = 0;
}
else {
if ((*(uint *)(this + 0x14c) & 0x1000) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
bVar5 = (byte)((uint)*(undefined4 *)(this + 0x14c) >> 8);
}
iVar4 = (int)SQRT(*(float *)(this + 0x274) * *(float *)(this + 0x274) +
*(float *)(this + 0x27c) * *(float *)(this + 0x27c) +
*(float *)(this + 0x278) * *(float *)(this + 0x278));
iVar6 = 0x200;
if (iVar4 < 0x201) {
iVar6 = iVar4;
}
}
if (((byte)this[0x1cb0] & 2) != 0) {
iVar6 = iVar6 + 100;
}
*(int *)(this + 0x1e00) = iVar6;
iVar4 = *(int *)(iVar3 + 8);
iVar2 = iVar6;
if ((iVar6 <= iVar4) && (iVar2 = iVar4, iVar6 < iVar4)) {
iVar4 = (int)((float)iVar4 - *(float *)(gpGlobals + 0x10) * 250.0);
iVar2 = 0;
if (iVar6 <= iVar4) {
iVar2 = iVar4;
}
}
if ((bVar5 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
*(undefined4 *)(iVar3 + 0x24) = *(undefined4 *)(this + 0x2e0);
*(undefined4 *)(iVar3 + 0x28) = *(undefined4 *)(this + 0x2e4);
uVar1 = *(undefined4 *)(this + 0x2e8);
*(undefined4 *)(iVar3 + 0x10) = 4;
*(int *)(iVar3 + 8) = iVar2;
*(undefined4 *)(iVar3 + 0x2c) = uVar1;
return;
}
*(undefined4 *)(iVar3 + 8) = 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.