CSoundEmitterSystem::EmitCloseCaption
0x004bd1d0 · 530 bytes · __thiscall
_ZN19CSoundEmitterSystem16EmitCloseCaptionER16IRecipientFilteriRK16CSoundParametersRK11EmitSound_t
Decompiled
undefined (5 params)
/* CSoundEmitterSystem::EmitCloseCaption(IRecipientFilter&, int, CSoundParameters const&,
EmitSound_t const&) */
void __thiscall
CSoundEmitterSystem::EmitCloseCaption
(CSoundEmitterSystem *this,IRecipientFilter *param_1,int param_2,CSoundParameters *param_3
,EmitSound_t *param_4)
{
CSoundParameters CVar1;
byte *pbVar2;
uint uVar3;
char cVar4;
bool bVar5;
int iVar6;
int *piVar7;
CSoundParameters *pCVar8;
byte *pbVar9;
undefined *puVar10;
bool bVar11;
longdouble lVar12;
float local_40;
CRecipientFilter local_3c [44];
if ((*(int *)(gpGlobals + 0x14) == 1) && (*(int *)(*(int *)(g_pClosecaption + 0x1c) + 0x30) == 0))
{
return;
}
pCVar8 = param_3 + 0x20;
do {
CVar1 = *pCVar8;
if ((((byte)CVar1 & 0xfd) != 0x21) && (2 < (byte)((char)CVar1 - 0x28U))) {
if (((byte)((char)CVar1 - 0x3eU) < 3) || (CVar1 == (CSoundParameters)0x3c)) {
if (CVar1 == (CSoundParameters)0x24) goto LAB_004bd270;
}
else if ((CVar1 != (CSoundParameters)0x5e) && (CVar1 != (CSoundParameters)0x7d)) break;
}
pCVar8 = pCVar8 + 1;
} while( true );
if (CVar1 == (CSoundParameters)0x24) {
LAB_004bd270:
bVar11 = true;
}
else {
if (param_4[0x24] == (EmitSound_t)0x0) {
return;
}
bVar11 = false;
}
CRecipientFilter::CRecipientFilter(local_3c);
/* try { // try from 004bd28a to 004bd40a has its CatchHandler @ 004bd413 */
CRecipientFilter::CopyFrom(local_3c,(CRecipientFilter *)param_1);
if (bVar11 == false) {
CBaseEntity::RemoveRecipientsIfNotCloseCaptioning(local_3c);
}
iVar6 = CRecipientFilter::GetRecipientCount(local_3c);
if (iVar6 < 1) goto LAB_004bd38b;
if (*(float **)(param_4 + 0x20) == (float *)0x0) {
lVar12 = (longdouble)(**(code **)(*enginesound + 0x10))(enginesound,param_3 + 0x20);
local_40 = (float)lVar12;
}
else {
local_40 = **(float **)(param_4 + 0x20);
}
pbVar2 = *(byte **)(gpGlobals + 0x58);
if ((uint)param_2 < 0x800) {
if (pbVar2 != (byte *)0x0) {
pbVar9 = pbVar2 + param_2 * 0x10;
if ((pbVar2[param_2 * 0x10] & 2) != 0) goto LAB_004bd3d8;
LAB_004bd2ea:
piVar7 = *(int **)(pbVar9 + 0xc);
if (piVar7 != (int *)0x0) {
piVar7 = (int *)(**(code **)(*piVar7 + 0x18))(piVar7);
while (piVar7 != (int *)0x0) {
cVar4 = (**(code **)(*piVar7 + 0x16c))(piVar7);
if (cVar4 != '\0') {
bVar5 = true;
goto LAB_004bd341;
}
uVar3 = piVar7[0x88];
if (((uVar3 == 0xffffffff) ||
(puVar10 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)
) || (*(uint *)(puVar10 + 8) != uVar3 >> 0xc)) break;
piVar7 = *(int **)(puVar10 + 4);
}
}
}
}
else if (pbVar2 != (byte *)0x0) {
LAB_004bd3d8:
pbVar9 = pbVar2;
if ((*pbVar2 & 2) == 0) goto LAB_004bd2ea;
}
bVar5 = false;
LAB_004bd341:
EmitCloseCaption(this,param_1,param_2,bVar5,*(char **)(param_4 + 4),(CUtlVector *)(param_4 + 0x2c)
,local_40,(bool)param_4[0x25],bVar11);
LAB_004bd38b:
CRecipientFilter::~CRecipientFilter(local_3c);
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.