L L4D2node

CEnvMicrophone::OnSoundPlayed

0x00689150 · 303 bytes · __cdecl

_ZN14CEnvMicrophone13OnSoundPlayedEiPKc12soundlevel_tfiiPK6VectorfR10CUtlVectorIS3_10CUtlMemoryIS3_iEE

Decompiled

undefined (9 params)

/* CEnvMicrophone::OnSoundPlayed(int, char const*, soundlevel_t, float, int, int, Vector const*,
   float, CUtlVector<Vector, CUtlMemory<Vector, int> >&) */

undefined1
CEnvMicrophone::OnSoundPlayed
          (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
          undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
          undefined4 param_9)

{
  uint uVar1;
  int iVar2;
  undefined *puVar3;
  int iVar4;
  int iVar5;
  undefined1 local_1d;
  
  if (DAT_00fdba68 < 1) {
    return 0;
  }
  iVar4 = DAT_00fdba68 + -1;
  local_1d = 0;
  iVar5 = iVar4 * 4;
LAB_0068918f:
  do {
    uVar1 = *(uint *)(s_Microphones + iVar5);
    if ((((uVar1 != 0xffffffff) &&
         (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar3 + 8) == uVar1 >> 0xc)) &&
       (*(CEnvMicrophone **)(puVar3 + 4) != (CEnvMicrophone *)0x0)) {
      iVar2 = SoundPlayed(*(CEnvMicrophone **)(puVar3 + 4),param_1,param_2,param_3,param_4,param_5,
                          param_6,param_7,param_8,param_9);
      if (iVar2 == 1) {
        local_1d = 1;
      }
      else if ((iVar2 == 2) && (0 < DAT_00fdba68)) {
        iVar2 = DAT_00fdba68 + -1;
        if (iVar4 != iVar2) {
          *(undefined4 *)(s_Microphones + iVar5) = *(undefined4 *)(s_Microphones + iVar2 * 4);
          iVar2 = DAT_00fdba68 + -1;
        }
        iVar4 = iVar4 + -1;
        iVar5 = iVar5 + -4;
        DAT_00fdba68 = iVar2;
        if (iVar4 == -1) {
          return local_1d;
        }
        goto LAB_0068918f;
      }
    }
    iVar4 = iVar4 + -1;
    iVar5 = iVar5 + -4;
    if (iVar4 == -1) {
      return local_1d;
    }
  } while( true );
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)