L L4D2node

CEnvMicrophone::SoundPlayed

0x00688b90 · 1355 bytes · __thiscall

_ZN14CEnvMicrophone11SoundPlayedEiPKc12soundlevel_tfiiPK6VectorfR10CUtlVectorIS3_10CUtlMemoryIS3_iEE

Decompiled

undefined (10 params)

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

uint __thiscall
CEnvMicrophone::SoundPlayed
          (CEnvMicrophone *this,undefined4 param_1,char *param_2,undefined4 param_4,
          undefined4 param_5,uint param_6,undefined4 param_7,undefined4 param_8,undefined4 param_9,
          CUtlVector<Vector,CUtlMemory<Vector,int>> *param_10)

{
  undefined4 uVar1;
  CUtlVector<Vector,CUtlMemory<Vector,int>> *this_00;
  char cVar2;
  int *piVar3;
  uint *puVar4;
  undefined1 *puVar5;
  uint uVar6;
  undefined *puVar7;
  uint uVar8;
  int iVar9;
  undefined1 *puVar10;
  undefined *puVar11;
  CBaseEntity *this_01;
  int iVar12;
  int local_90;
  undefined **local_80 [8];
  undefined4 local_60;
  char *local_5c;
  undefined4 local_58;
  undefined4 local_54;
  uint local_50;
  undefined4 local_4c;
  CBaseEntity *local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  undefined4 local_38;
  int local_34 [5];
  undefined2 local_20;
  
  this_00 = param_10;
  if (((this[0x460] != (CEnvMicrophone)0x0) || ((param_6 & 0x40) != 0)) ||
     (cVar2 = CanHearSound(this,param_1,param_4,&param_5,param_8), cVar2 == '\0')) {
    return 0;
  }
  uVar6 = *(uint *)(this + 0x45c);
  puVar11 = g_pEntityList;
  if (((uVar6 == 0xffffffff) ||
      (puVar7 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar7 + 8) != uVar6 >> 0xc || (*(int *)(puVar7 + 4) == 0)))) {
    if (*(char **)(this + 0x458) == (char *)0x0) {
LAB_00688d0a:
      if ((uVar6 != 0xffffffff) &&
         (piVar3 = (int *)(puVar11 + (uVar6 & 0xfff) * 0x10 + 4), piVar3 != (int *)0x0))
      goto LAB_00688d2a;
    }
    else {
      piVar3 = (int *)CGlobalEntityList::FindEntityByName
                                ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,
                                 *(char **)(this + 0x458),(CBaseEntity *)0x0,(CBaseEntity *)0x0,
                                 (CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
      if (piVar3 == (int *)0x0) {
        *(undefined4 *)(this + 0x45c) = 0xffffffff;
LAB_00688cba:
        puVar10 = *(undefined1 **)(this + 0x458);
        if (puVar10 == (undefined1 *)0x0) {
          puVar10 = &DAT_00d539c2;
        }
        puVar5 = &DAT_00d539c2;
        if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
          puVar5 = *(undefined1 **)(this + 0x154);
        }
        Warning("EnvMicrophone %s specifies a non-existent speaker name: %s\n",puVar5,puVar10);
        puVar11 = g_pEntityList;
        *(undefined4 *)(this + 0x458) = 0;
        uVar6 = *(uint *)(this + 0x45c);
        goto LAB_00688d0a;
      }
      puVar4 = (uint *)(**(code **)(*piVar3 + 0xc))(piVar3);
      uVar6 = *puVar4;
      *(uint *)(this + 0x45c) = uVar6;
      if (uVar6 == 0xffffffff) goto LAB_00688cba;
      uVar8 = uVar6 & 0xfff;
      piVar3 = (int *)(g_pEntityList + uVar8 * 0x10 + 4);
      if (((piVar3 == (int *)0x0) || (*(uint *)(g_pEntityList + uVar8 * 0x10 + 8) != uVar6 >> 0xc))
         || (puVar11 = g_pEntityList, *(int *)(g_pEntityList + uVar8 * 0x10 + 4) == 0))
      goto LAB_00688cba;
LAB_00688d2a:
      if ((piVar3[1] == uVar6 >> 0xc) && (*piVar3 != 0)) goto LAB_00688d40;
    }
    uVar6 = 2;
  }
  else {
LAB_00688d40:
    if (((*(int *)(this + 0x5b8) == *(int *)(gpGlobals + 4)) && (this[0x4b8] != (CEnvMicrophone)0x0)
        ) && (iVar9 = _V_strcmp((char *)(this + 0x4b8),param_2), puVar11 = g_pEntityList, iVar9 == 0
             )) {
      uVar6 = *(uint *)(this + 0x148) >> 4 & 1;
    }
    else {
      piVar3 = (int *)0x0;
      param_5 = 0x3f800000;
      this[0x460] = (CEnvMicrophone)0x1;
      uVar6 = *(uint *)(this + 0x45c);
      uVar8 = param_6 | 0x40;
      if (((uVar6 != 0xffffffff) &&
          (puVar11 = puVar11 + (uVar6 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar11 + 8) == uVar6 >> 0xc)) {
        piVar3 = *(int **)(puVar11 + 4);
      }
      (**(code **)(*piVar3 + 0x28c))(&local_60,piVar3);
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
      local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00688dcf to 00688dd3 has its CatchHandler @ 0068914a */
      CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
      local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00688de7 to 00688e09 has its CatchHandler @ 0068912e */
      (**(code **)(*piVar3 + 0x28c))(&local_60,piVar3);
      CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
      local_20 = 0xffff;
      this_01 = (CBaseEntity *)0x0;
      local_48 = (CBaseEntity *)0x0;
      local_44 = 0;
      local_40 = 0;
      local_5c = param_2;
      local_3c = 1;
      local_3b = 0;
      local_3a = 0;
      local_54 = param_4;
      local_38 = 0xffffffff;
      local_34[0] = 0;
      local_34[1] = 0;
      local_4c = param_7;
      local_34[2] = 0;
      local_34[3] = 0;
      local_34[4] = 0;
      uVar6 = *(uint *)(this + 0x45c);
      local_60 = 6;
      local_58 = param_5;
      if (((uVar6 != 0xffffffff) &&
          (puVar11 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar11 + 8) == uVar6 >> 0xc)) {
        this_01 = *(CBaseEntity **)(puVar11 + 4);
      }
      local_50 = uVar8;
      if (((byte)this_01[0x14d] & 8) != 0) {
                    /* try { // try from 006890ab to 006890af has its CatchHandler @ 006890f2 */
        CBaseEntity::CalcAbsolutePosition(this_01);
        uVar6 = *(uint *)(this + 0x45c);
      }
      local_48 = this_01 + 0x2e0;
      iVar9 = 0;
      local_44 = param_9;
      local_38 = param_1;
      if (((uVar6 != 0xffffffff) &&
          (puVar11 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar11 + 8) == uVar6 >> 0xc)) {
        iVar9 = *(int *)(puVar11 + 4);
      }
      local_90 = 0;
      if (*(int *)(iVar9 + 0x30) != 0) {
        local_90 = *(int *)(iVar9 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
                    /* try { // try from 00688f45 to 00688fc7 has its CatchHandler @ 006890f2 */
      CBaseEntity::EmitSound((IRecipientFilter *)local_80,local_90,(EmitSound_t *)&local_60);
      V_strncpy((char *)(this + 0x4b8),param_2,0x100);
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x488),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
      iVar9 = 0;
      uVar1 = *(undefined4 *)(gpGlobals + 4);
      this[0x460] = (CEnvMicrophone)0x0;
      *(undefined4 *)(this + 0x5b8) = uVar1;
      if (0 < local_34[3]) {
        iVar12 = 0;
        do {
          CUtlVector<Vector,CUtlMemory<Vector,int>>::InsertBefore
                    (this_00,*(int *)(this_00 + 0xc),(Vector *)(local_34[0] + iVar12));
          iVar9 = iVar9 + 1;
          iVar12 = iVar12 + 0xc;
        } while (iVar9 < local_34[3]);
      }
      local_34[3] = 0;
      uVar6 = *(uint *)(this + 0x148) >> 4 & 1;
      CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)local_34);
      local_34[4] = local_34[0];
      CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)local_34);
      local_80[0] = &PTR__CPASFilter_00bfaf28;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
    }
  }
  return uVar6;
}

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)