CPASAttenuationFilter::Filter
0x00805cc0 · 584 bytes · __thiscall
_ZN21CPASAttenuationFilter6FilterERK6Vectorf
Decompiled
undefined (3 params)
/* CPASAttenuationFilter::Filter(Vector const&, float) */
void __thiscall
CPASAttenuationFilter::Filter(CPASAttenuationFilter *this,Vector *param_1,float param_2)
{
byte *pbVar1;
code *pcVar2;
char cVar3;
int iVar4;
byte *pbVar5;
int *piVar6;
uint uVar7;
int iVar8;
int *piVar9;
undefined *puVar10;
CPASAttenuationFilter **ppCVar11;
int *piVar12;
int *piVar13;
int local_54 [2];
CPASAttenuationFilter *local_4c [3];
int *local_40;
int local_3c;
float local_38;
int *local_34;
float local_30;
float local_28;
float local_24;
float local_20;
if ((*(int *)(gpGlobals + 0x14) != 1) && (0.0 < param_2)) {
local_4c[0] = this;
local_30 = 2000.0 / param_2;
iVar4 = (**(code **)(*(int *)this + 0x10))();
iVar4 = iVar4 + -1;
ppCVar11 = local_4c;
if (-1 < iVar4) {
do {
iVar8 = *(int *)this;
ppCVar11[1] = (CPASAttenuationFilter *)iVar4;
*ppCVar11 = this;
pcVar2 = *(code **)(iVar8 + 0x14);
ppCVar11[-1] = (CPASAttenuationFilter *)0x805d7c;
uVar7 = (*pcVar2)();
piVar9 = (int *)ppCVar11;
if (uVar7 < 0x800) {
pbVar1 = *(byte **)(gpGlobals + 0x58);
if (pbVar1 != (byte *)0x0) {
pbVar5 = pbVar1 + uVar7 * 0x10;
if ((*pbVar5 & 2) != 0) goto LAB_00805d8f;
LAB_00805d27:
piVar6 = *(int **)(pbVar5 + 0xc);
if (piVar6 != (int *)0x0) {
iVar8 = *piVar6;
*ppCVar11 = (CPASAttenuationFilter *)piVar6;
pcVar2 = *(code **)(iVar8 + 0x18);
ppCVar11[-1] = (CPASAttenuationFilter *)0x805d36;
piVar6 = (int *)(*pcVar2)();
if (piVar6 != (int *)0x0) {
iVar8 = *piVar6;
*ppCVar11 = (CPASAttenuationFilter *)piVar6;
pcVar2 = *(code **)(iVar8 + 0x16c);
ppCVar11[-1] = (CPASAttenuationFilter *)0x805d47;
cVar3 = (*pcVar2)();
if (cVar3 != '\0') {
iVar8 = *piVar6;
*ppCVar11 = (CPASAttenuationFilter *)piVar6;
pcVar2 = *(code **)(iVar8 + 0x16c);
ppCVar11[-1] = (CPASAttenuationFilter *)0x805d56;
cVar3 = (*pcVar2)();
if ((cVar3 != '\0') && ((char)piVar6[0x729] == '\0')) {
iVar8 = *piVar6;
ppCVar11[1] = (CPASAttenuationFilter *)piVar6;
*ppCVar11 = (CPASAttenuationFilter *)&local_28;
pcVar2 = *(code **)(iVar8 + 0x240);
ppCVar11[-1] = (CPASAttenuationFilter *)0x805db2;
(*pcVar2)();
local_34 = (int *)((local_24 - *(float *)(param_1 + 4)) *
(local_24 - *(float *)(param_1 + 4)) +
(local_20 - *(float *)(param_1 + 8)) *
(local_20 - *(float *)(param_1 + 8)) +
(local_28 - *(float *)param_1) *
(local_28 - *(float *)param_1));
piVar9 = (int *)(ppCVar11 + -1);
if (local_30 < SQRT((float)local_34)) {
ppCVar11[-1] = (CPASAttenuationFilter *)piVar6;
ppCVar11[-2] = (CPASAttenuationFilter *)0x805e0d;
iVar8 = CBasePlayer::GetSplitScreenPlayers((CBasePlayer *)ppCVar11[-1]);
piVar13 = (int *)(ppCVar11 + -1);
if (*(int *)(iVar8 + 0xc) != 0) {
ppCVar11[-1] = (CPASAttenuationFilter *)piVar6;
ppCVar11[-2] = (CPASAttenuationFilter *)0x805e20;
piVar9 = (int *)CBasePlayer::GetSplitScreenPlayers
((CBasePlayer *)ppCVar11[-1]);
piVar13 = (int *)(ppCVar11 + -1);
if (0 < piVar9[3]) {
iVar8 = 0;
local_40 = piVar6;
local_3c = iVar4;
local_34 = piVar9;
piVar12 = (int *)ppCVar11;
do {
piVar9 = (int *)0x0;
uVar7 = *(uint *)(*local_34 + iVar8 * 4);
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10,
puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
piVar9 = *(int **)(puVar10 + 4);
}
iVar4 = *piVar9;
*piVar12 = (int)piVar9;
piVar12[-1] = (int)&local_28;
pcVar2 = *(code **)(iVar4 + 0x240);
piVar12[-2] = 0x805e52;
(*pcVar2)();
piVar13 = piVar12 + -2;
local_38 = (local_28 - *(float *)param_1) *
(local_28 - *(float *)param_1) +
(local_20 - *(float *)(param_1 + 8)) *
(local_20 - *(float *)(param_1 + 8)) +
(local_24 - *(float *)(param_1 + 4)) *
(local_24 - *(float *)(param_1 + 4));
piVar9 = piVar12 + -2;
iVar4 = local_3c;
if (SQRT(local_38) <= local_30) goto LAB_00805d68;
iVar8 = iVar8 + 1;
piVar6 = local_40;
piVar12 = piVar12 + -1;
} while (iVar8 < local_34[3]);
}
}
piVar13[1] = (int)piVar6;
*piVar13 = (int)this;
piVar13[-1] = 0x805f00;
CRecipientFilter::RemoveRecipient
((CRecipientFilter *)*piVar13,(CBasePlayer *)piVar13[1]);
piVar9 = piVar13;
}
}
}
}
}
}
}
else {
pbVar1 = *(byte **)(gpGlobals + 0x58);
if (*(byte **)(gpGlobals + 0x58) != (byte *)0x0) {
LAB_00805d8f:
pbVar5 = pbVar1;
if ((*pbVar5 & 2) == 0) goto LAB_00805d27;
}
}
LAB_00805d68:
iVar4 = iVar4 + -1;
ppCVar11 = (CPASAttenuationFilter **)piVar9;
} while (iVar4 != -1);
}
}
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.