CEnvMicrophone::Think
0x006880d0 · 447 bytes · __thiscall
_ZN14CEnvMicrophone5ThinkEv
Decompiled
undefined (1 param)
/* CEnvMicrophone::Think() */
void __thiscall CEnvMicrophone::Think(CEnvMicrophone *this)
{
float fVar1;
bool bVar2;
char cVar3;
int iVar4;
CSound *pCVar5;
float *pfVar6;
float local_40;
float local_38;
float local_34;
float local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
iVar4 = CSoundEnt::ActiveList();
bVar2 = false;
local_40 = 0.0;
if (iVar4 != -1) {
do {
while ((pCVar5 = (CSound *)CSoundEnt::SoundPointerForIndex(iVar4), pCVar5 == (CSound *)0x0 ||
((*(uint *)(this + 0x448) & *(uint *)(pCVar5 + 0x10)) == 0))) {
LAB_00688100:
iVar4 = (int)*(short *)(pCVar5 + 0x1c);
if (iVar4 == -1) goto LAB_00688160;
}
local_30 = 0.0;
cVar3 = CanHearSound(this,pCVar5,&local_30);
if ((cVar3 == '\0') || (local_30 <= local_40)) goto LAB_00688100;
iVar4 = (int)*(short *)(pCVar5 + 0x1c);
local_40 = local_30;
bVar2 = true;
} while (iVar4 != -1);
LAB_00688160:
if (bVar2) {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x4a0),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
}
}
fVar1 = *(float *)(this + 0x470);
if (local_40 != fVar1) {
if (ABS(local_40 - fVar1) < 0.005) {
pfVar6 = &local_38;
local_38 = local_40;
}
else {
pfVar6 = &local_34;
local_34 = (1.0 - *(float *)(this + 0x450)) * local_40 + fVar1 * *(float *)(this + 0x450);
}
variant_t::Set((variant_t *)(this + 0x470),1,pfVar6);
local_30 = *(float *)(this + 0x470);
local_2c = *(undefined4 *)(this + 0x474);
local_28 = *(undefined4 *)(this + 0x478);
local_24 = *(undefined4 *)(this + 0x47c);
local_20 = *(undefined4 *)(this + 0x480);
CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x470),&local_30,this,this,0);
}
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
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.