CSceneManager::OnClientActive
0x008162b0 · 603 bytes · __cdecl
_ZN13CSceneManager14OnClientActiveEP11CBasePlayer
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CSceneManager::OnClientActive(CBasePlayer*) */
void CSceneManager::OnClientActive(CBasePlayer *param_1)
{
uint uVar1;
int *piVar2;
code *pcVar3;
int iVar4;
undefined *puVar5;
uint *puVar6;
float *pfVar7;
float *pfVar8;
int iVar9;
float afStack_b8 [9];
int local_94;
int local_90;
undefined **local_80 [8];
undefined4 local_60;
uint *local_5c;
undefined4 local_58;
uint local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
float 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;
iVar9 = 0;
local_90 = 0;
local_94 = *(int *)(param_1 + 0x460);
pfVar8 = afStack_b8 + 3;
if (0 < local_94) {
do {
puVar6 = (uint *)(*(int *)(param_1 + 0x454) + iVar9);
uVar1 = *puVar6;
pfVar7 = pfVar8;
if ((((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) &&
((piVar2 = *(int **)(puVar5 + 4), piVar2 != (int *)0x0 &&
(ABS((float)puVar6[0x22] * 1000.0) <= 4096.0)))) {
iVar4 = *piVar2;
pfVar8[1] = (float)piVar2;
*pfVar8 = (float)&local_60;
pcVar3 = *(code **)(iVar4 + 0x28c);
pfVar8[-1] = 1.1882445e-38;
(*pcVar3)();
pfVar8[-1] = (float)local_80;
pfVar8[-2] = 1.1882464e-38;
CRecipientFilter::CRecipientFilter((CRecipientFilter *)pfVar8[-1]);
local_80[0] = &PTR__CPASFilter_00bfaf28;
*pfVar8 = (float)&local_60;
pfVar8[-1] = (float)local_80;
/* try { // try from 0081638e to 00816392 has its CatchHandler @ 00816515 */
pfVar8[-2] = 1.18825e-38;
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)pfVar8[-1],(Vector *)*pfVar8);
local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
iVar4 = *piVar2;
*pfVar8 = (float)piVar2;
pfVar8[-1] = (float)&local_60;
/* try { // try from 008163a6 to 008163c5 has its CatchHandler @ 00816540 */
pcVar3 = *(code **)(iVar4 + 0x28c);
pfVar8[-2] = 1.1882535e-38;
(*pcVar3)();
pfVar7 = pfVar8 + -2;
*pfVar8 = 0.8;
pfVar8[-1] = (float)&local_60;
pfVar8[-2] = (float)local_80;
pfVar8[-3] = 1.1882571e-38;
CPASAttenuationFilter::Filter
((CPASAttenuationFilter *)pfVar8[-2],(Vector *)pfVar8[-1],*pfVar8);
local_20 = 0xffff;
local_5c = puVar6 + 1;
local_58 = 0x3f800000;
local_50 = 0;
local_4c = 100;
local_48 = 0;
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 = 2;
local_54 = puVar6[0x21];
local_44 = *(float *)(gpGlobals + 0xc) - (float)puVar6[0x22];
uVar1 = *puVar6;
if ((uVar1 == 0xffffffff) ||
((puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)))) {
iVar4 = _DAT_00000030;
if (_DAT_00000030 == 0) goto LAB_008164f8;
LAB_0081648f:
iVar4 = iVar4 - *(int *)(gpGlobals + 0x58) >> 4;
}
else {
iVar4 = *(int *)(*(int *)(puVar5 + 4) + 0x30);
if (iVar4 != 0) goto LAB_0081648f;
LAB_008164f8:
iVar4 = 0;
}
pfVar8[-1] = (float)iVar4;
*pfVar8 = (float)&local_60;
pfVar8[-2] = (float)local_80;
/* try { // try from 008164a6 to 008164aa has its CatchHandler @ 0081652a */
pfVar8[-3] = 1.1882892e-38;
CBaseEntity::EmitSound
((IRecipientFilter *)pfVar8[-2],(int)pfVar8[-1],(EmitSound_t *)*pfVar8);
local_28 = 0;
pfVar8[-2] = (float)&local_34;
pfVar8[-3] = 1.1882917e-38;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)pfVar8[-2]);
pfVar8[-2] = (float)&local_34;
local_24 = local_34;
pfVar8[-3] = 1.1882937e-38;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)pfVar8[-2]);
local_80[0] = &PTR__CPASFilter_00bfaf28;
pfVar8[-2] = (float)local_80;
pfVar8[-3] = 1.1882962e-38;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)pfVar8[-2]);
}
local_90 = local_90 + 1;
iVar9 = iVar9 + 0x8c;
pfVar8 = pfVar7;
} while (local_90 != local_94);
}
*(undefined4 *)(param_1 + 0x460) = 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.