CSoundscapeSystem::FrameUpdatePostEntityThink
0x00830a70 · 457 bytes · __thiscall
_ZN17CSoundscapeSystem26FrameUpdatePostEntityThinkEv
Decompiled
undefined (1 param)
/* CSoundscapeSystem::FrameUpdatePostEntityThink() */
void __thiscall CSoundscapeSystem::FrameUpdatePostEntityThink(CSoundscapeSystem *this)
{
code *pcVar1;
int iVar2;
uint uVar3;
char cVar4;
int *piVar5;
ushort *puVar6;
int iVar7;
int iVar8;
int iVar9;
int *piVar10;
int *piVar11;
int aiStack_74 [7];
int local_58;
int local_54;
int local_50;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
int *local_3c;
int local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
undefined1 local_20;
if (0 < *(int *)(this + 0x20)) {
uVar3 = -(uint)(*(int *)(soundscape_debug._28_4_ + 0x30) == 0);
iVar8 = *(int *)(gpGlobals + 0x14);
aiStack_74[6] = (uVar3 & 0xffffd8f5) + 9999;
aiStack_74[5] = (uVar3 & 0xffffffe2) + 0x20;
if (0 < iVar8) {
local_50 = 0;
local_58 = 0;
local_54 = 0;
piVar10 = aiStack_74 + 2;
do {
iVar8 = (*(int *)(this + 0x50) + 1) % iVar8;
*(int *)(this + 0x50) = iVar8;
*piVar10 = iVar8 + 1;
piVar10[-1] = 0x830aef;
piVar5 = (int *)UTIL_PlayerByIndex(*piVar10);
piVar11 = piVar10;
if (piVar5 != (int *)0x0) {
iVar8 = *piVar5;
*piVar10 = (int)piVar5;
pcVar1 = *(code **)(iVar8 + 0x170);
piVar10[-1] = 0x830b04;
cVar4 = (*pcVar1)();
if (cVar4 != '\0') {
iVar8 = piVar5[0x702];
if ((iVar8 < 1) || (*(int *)(this + 0x20) < iVar8)) {
iVar8 = 0;
}
else {
iVar8 = *(int *)(*(int *)(this + 0x14) + -4 + iVar8 * 4);
}
iVar7 = *piVar5;
piVar10[1] = (int)piVar5;
*piVar10 = (int)&local_48;
pcVar1 = *(code **)(iVar7 + 0x240);
piVar10[-1] = 0x830b42;
local_3c = piVar5;
local_38 = iVar8;
(*pcVar1)();
local_20 = 0;
piVar11 = piVar10 + -1;
local_28 = 0;
local_34 = local_48;
local_24 = 0;
local_30 = local_44;
local_2c = local_40;
if (iVar8 != 0) {
piVar10[-1] = iVar8;
*piVar10 = (int)&local_3c;
piVar10[-2] = 0x830b88;
CEnvSoundscape::UpdateForPlayer((CEnvSoundscape *)piVar10[-1],(ss_update_t *)*piVar10)
;
}
iVar8 = *engine;
*piVar10 = (int)&local_34;
piVar10[-1] = (int)engine;
pcVar1 = *(code **)(iVar8 + 0x30);
piVar10[-2] = 0x830b9c;
iVar8 = (*pcVar1)();
if ((-1 < iVar8) && (iVar8 < *(int *)(this + 0x34))) {
iVar7 = *(int *)(this + 0x28);
puVar6 = (ushort *)(iVar7 + iVar8 * 4);
if (*puVar6 != 0) {
iVar9 = 0;
do {
iVar2 = *(int *)(*(int *)(this + 0x14) +
(uint)*(ushort *)
(*(int *)(this + 0x3c) + ((uint)puVar6[1] + iVar9) * 2) * 4
);
if ((iVar2 != 0) && (iVar2 != local_38)) {
piVar10[-1] = iVar2;
*piVar10 = (int)&local_3c;
piVar10[-2] = 0x830beb;
CEnvSoundscape::UpdateForPlayer
((CEnvSoundscape *)piVar10[-1],(ss_update_t *)*piVar10);
iVar7 = *(int *)(this + 0x28);
}
puVar6 = (ushort *)(iVar7 + iVar8 * 4);
iVar9 = iVar9 + 1;
} while (iVar9 < (int)(uint)*puVar6);
}
}
local_58 = local_58 + 1;
local_54 = local_54 + local_24;
}
}
local_50 = local_50 + 1;
iVar8 = *(int *)(gpGlobals + 0x14);
} while (((local_50 < iVar8) && (local_54 <= aiStack_74[6])) &&
(piVar10 = piVar11, local_58 <= aiStack_74[5]));
}
}
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.