CSoundControllerImp::SystemUpdate
0x004bf9d0 · 1513 bytes · __thiscall
_ZN19CSoundControllerImp12SystemUpdateEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CSoundControllerImp::SystemUpdate() */
void __thiscall CSoundControllerImp::SystemUpdate(CSoundControllerImp *this)
{
float fVar1;
float fVar2;
SoundCommand_t *pSVar3;
CSoundPatch *this_00;
char cVar4;
int iVar5;
int iVar6;
int iVar7;
longdouble lVar8;
float fVar9;
undefined1 *puVar10;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
CSoundPatch *local_2c;
undefined4 local_28;
undefined4 local_24;
CSoundPatch *local_20;
local_44 = 0;
local_40 = 0;
if (___atan2f_finite == (CSoundPatch *)0x0) {
local_2c = (CSoundPatch *)0x0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_44,0,0,0,0,
"/data/src/game/server/../../game/shared/soundenvelope.cpp",0x3e5,
&SystemUpdate()::tm_fmt,"(%s)%s","Unaccounted","CSoundControllerImp::SystemUpdate");
local_2c = ___atan2f_finite;
}
iVar7 = _DAT_0105db00;
local_34 = local_44;
local_30 = local_40;
/* try { // try from 004bfede to 004bff2c has its CatchHandler @ 004c0041 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
if (*(char **)_DAT_0105d15c != "CSoundControllerImp::SystemUpdate") {
_DAT_0105d15c =
(CSoundPatch *)
CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc1e334,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 004bfa8d to 004bfb28 has its CatchHandler @ 004c001d */
puVar10 = g_pEffects;
lVar8 = (longdouble)(**(code **)(*(int *)g_pEffects + 0x2c))(g_pEffects);
fVar2 = (float)lVar8;
local_3c = 0;
local_38 = 0;
fVar1 = *(float *)(this + 0x3c);
*(float *)(this + 0x3c) = fVar2;
fVar9 = 0.0;
if (0.0 <= fVar2 - fVar1) {
fVar9 = fVar2 - fVar1;
}
if (___atan2f_finite == (CSoundPatch *)0x0) {
local_20 = (CSoundPatch *)0x0;
}
else {
puVar10 = ___atan2f_finite;
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_3c,0,0,0,0,
"/data/src/game/server/../../game/shared/soundenvelope.cpp",0x3f0,
&SystemUpdate()::tm_fmt,"(%s)%s","Unaccounted",
"CSoundControllerImp::SystemUpdate:processcommandlist");
local_20 = ___atan2f_finite;
}
iVar7 = _DAT_0105db00;
local_28 = local_3c;
local_24 = local_38;
/* try { // try from 004bfe76 to 004bfec4 has its CatchHandler @ 004bfff1 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
if (*(char **)_DAT_0105d15c != "CSoundControllerImp::SystemUpdate:processcommandlist") {
_DAT_0105d15c =
(CSoundPatch *)
CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc1e358,(char *)0x1,0xbfafa1);
}
puVar10 = _DAT_0105d15c;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
while ((iVar7 = _DAT_0105db00, *(int *)(this + 0x30) != 0 &&
(pSVar3 = (SoundCommand_t *)**(undefined4 **)(this + 0x24), *(float *)(pSVar3 + 4) <= fVar2
))) {
/* try { // try from 004bfb73 to 004bfb93 has its CatchHandler @ 004c0021 */
CUtlPriorityQueue<SoundCommand_t*,CDefUtlPriorityQueueLessFunc<SoundCommand_t*>,CUtlMemory<SoundCommand_t*,int>>
::RemoveAtHead((CUtlPriorityQueue<SoundCommand_t*,CDefUtlPriorityQueueLessFunc<SoundCommand_t*>,CUtlMemory<SoundCommand_t*,int>>
*)(this + 0x24));
ProcessCommand(this,pSVar3);
puVar10 = SoundCommand_t::s_Allocator;
CUtlMemoryPool::Free((CUtlMemoryPool *)SoundCommand_t::s_Allocator,pSVar3);
}
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(puVar10), iVar7 == iVar6)) {
puVar10 = _DAT_0105d15c;
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(CSoundPatch **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (CSoundPatch *)0x105d160;
}
if (local_20 != (CSoundPatch *)0x0) {
puVar10 = local_20;
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
local_3c = 0;
local_38 = 0;
if (___atan2f_finite == (CSoundPatch *)0x0) {
local_20 = (CSoundPatch *)0x0;
}
else {
/* try { // try from 004bfc5e to 004bfc60 has its CatchHandler @ 004c001d */
puVar10 = ___atan2f_finite;
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_3c,0,0,0,0,
"/data/src/game/server/../../game/shared/soundenvelope.cpp",0x406,
&SystemUpdate()::tm_fmt,"(%s)%s","Unaccounted",
"CSoundControllerImp::SystemUpdate:removesounds");
local_20 = ___atan2f_finite;
}
iVar7 = _DAT_0105db00;
local_28 = local_3c;
local_24 = local_38;
/* try { // try from 004bfdc6 to 004bfe14 has its CatchHandler @ 004c0045 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar6 = ThreadGetCurrentId(puVar10), iVar7 == iVar6)) {
if (*(char **)_DAT_0105d15c != "CSoundControllerImp::SystemUpdate:removesounds") {
_DAT_0105d15c =
(CSoundPatch *)
CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc1e390,(char *)0x1,0xbfafa1);
}
puVar10 = _DAT_0105d15c;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
iVar7 = *(int *)(this + 0x1c) + -1;
iVar6 = iVar7 * 4;
if (-1 < iVar7) {
do {
while( true ) {
this_00 = *(CSoundPatch **)(*(int *)(this + 0x10) + iVar6);
puVar10 = this_00;
/* try { // try from 004bfcd5 to 004bfcd9 has its CatchHandler @ 004c0031 */
cVar4 = CSoundPatch::Update(this_00,fVar2,fVar9);
if (cVar4 == '\0') break;
LAB_004bfca8:
iVar7 = iVar7 + -1;
iVar6 = iVar6 + -4;
if (iVar7 == -1) goto LAB_004bfd13;
}
*(undefined4 *)(this_00 + 0x28) = 0;
if (*(int *)(this + 0x1c) < 1) goto LAB_004bfca8;
iVar5 = *(int *)(this + 0x1c) + -1;
if (iVar7 != iVar5) {
*(undefined4 *)(*(int *)(this + 0x10) + iVar6) =
*(undefined4 *)(*(int *)(this + 0x10) + iVar5 * 4);
iVar5 = *(int *)(this + 0x1c) + -1;
}
iVar7 = iVar7 + -1;
iVar6 = iVar6 + -4;
*(int *)(this + 0x1c) = iVar5;
} while (iVar7 != -1);
}
LAB_004bfd13:
iVar7 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(puVar10), iVar7 == iVar6)) {
puVar10 = _DAT_0105d15c;
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(CSoundPatch **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (CSoundPatch *)0x105d160;
}
if (local_20 != (CSoundPatch *)0x0) {
puVar10 = local_20;
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
iVar7 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(puVar10), iVar7 == iVar6)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = *(CSoundPatch **)(_DAT_0105d15c + 100);
}
DAT_0105d158 = _DAT_0105d15c == (CSoundPatch *)0x105d160;
}
if (local_2c != (CSoundPatch *)0x0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,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.