L L4D2node

CSoundPatch::Update

0x004bf350 · 1163 bytes · __thiscall

_ZN11CSoundPatch6UpdateEff

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CSoundPatch::Update(float, float) */

undefined4 __thiscall CSoundPatch::Update(CSoundPatch *this,float param_1,float param_2)

{
  char cVar1;
  int iVar2;
  undefined1 *puVar3;
  uint uVar4;
  int iVar5;
  undefined *puVar6;
  undefined4 uVar7;
  longdouble lVar8;
  float fVar9;
  CSoundPatch *in_stack_ffffff44;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  CSoundPatch *local_64;
  undefined4 local_60;
  undefined1 *local_5c;
  float local_58;
  undefined4 local_54;
  uint local_50;
  int local_4c;
  CSoundPatch *local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined2 local_20;
  
  local_74 = 0;
  local_70 = 0;
  if (___atan2f_finite == (CSoundPatch *)0x0) {
    local_64 = (CSoundPatch *)0x0;
  }
  else {
    in_stack_ffffff44 = ___atan2f_finite;
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_74,0,0,0,0,
               "/data/src/game/server/../../game/shared/soundenvelope.cpp",0x231,
               &Update(float,float)::tm_fmt,"(%s)%s","Unaccounted","CSoundPatch::Update");
    local_64 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_6c = local_74;
  local_68 = local_70;
                    /* try { // try from 004bf404 to 004bf408 has its CatchHandler @ 004bf7f7 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar2 = ThreadGetCurrentId(), iVar5 == iVar2)) {
    if (*(char **)_DAT_0105d15c != "CSoundPatch::Update") {
                    /* try { // try from 004bf530 to 004bf541 has its CatchHandler @ 004bf7f7 */
      _DAT_0105d15c =
           (CSoundPatch *)
           CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc1e00a,(char *)0x1,0xbfafa1);
    }
    in_stack_ffffff44 = _DAT_0105d15c;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  if ((*(float *)(this + 0x28) == 0.0) || (param_1 <= *(float *)(this + 0x28))) {
    uVar4 = *(uint *)(this + 0x38);
    if ((((uVar4 != 0xffffffff) &&
         ((puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
          (*(uint *)(puVar6 + 8) == uVar4 >> 0xc)))) && (*(int *)(puVar6 + 4) != 0)) &&
       ((iVar5 = *(int *)(*(int *)(puVar6 + 4) + 0x30), iVar5 == 0 ||
        (-0x10 < iVar5 - *(int *)(gpGlobals + 0x58))))) {
      if (this[0xc] == (CSoundPatch)0x0) {
        fVar9 = *(float *)this;
        if (fVar9 != *(float *)(this + 4)) goto LAB_004bf5b6;
        *(uint *)(this + 0x50) = *(uint *)(this + 0x50) & 0xfffffffd;
      }
      else {
        fVar9 = *(float *)this;
        this[0xc] = (CSoundPatch)0x0;
LAB_004bf5b6:
                    /* try { // try from 004bf5d6 to 004bf622 has its CatchHandler @ 004bf80c */
        lVar8 = (longdouble)Approach(*(float *)(this + 4),fVar9,param_2 * *(float *)(this + 8));
        *(uint *)(this + 0x50) = *(uint *)(this + 0x50) | 2;
        *(float *)this = (float)lVar8;
      }
      if (this[0x1c] == (CSoundPatch)0x0) {
        if (*(float *)(this + 0x10) != *(float *)(this + 0x14)) goto LAB_004bf5f9;
        uVar7 = 1;
        uVar4 = *(uint *)(this + 0x50) & 0xfffffffe;
        *(uint *)(this + 0x50) = uVar4;
        if (uVar4 == 0) goto LAB_004bf47a;
      }
      else {
        this[0x1c] = (CSoundPatch)0x0;
LAB_004bf5f9:
        lVar8 = (longdouble)
                Approach(*(float *)(this + 0x14),*(float *)(this + 0x10),
                         param_2 * *(float *)(this + 0x18));
        *(float *)(this + 0x10) = (float)lVar8;
        uVar4 = *(uint *)(this + 0x50) | 1;
      }
      local_50 = uVar4 | 1;
      local_20 = 0xffff;
      local_60 = *(undefined4 *)(this + 0x3c);
      *(uint *)(this + 0x50) = local_50;
      local_58 = *(float *)(this + 0x10) * *(float *)(this + 0x5c);
      uVar4 = *(uint *)(this + 0x38);
      local_48 = (CSoundPatch *)0x0;
      local_44 = 0;
      local_5c = &DAT_00d539c2;
      if (*(undefined1 **)(this + 0x30) != (undefined1 *)0x0) {
        local_5c = *(undefined1 **)(this + 0x30);
      }
      local_40 = 0;
      local_4c = (int)*(float *)this;
      local_54 = *(undefined4 *)(this + 0x24);
      local_3c = 1;
      local_3b = 0;
      local_3a = 0;
      local_38 = 0xffffffff;
      local_34 = 0;
      local_30 = 0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      if ((((uVar4 == 0xffffffff) ||
           (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
          (*(uint *)(puVar6 + 8) != uVar4 >> 0xc)) || (iVar5 = *(int *)(puVar6 + 4), iVar5 == 0)) {
LAB_004bf6f9:
        iVar5 = -1;
      }
      else {
        if ((*(int *)(iVar5 + 0x30) == 0) ||
           (*(int *)(iVar5 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 == 0)) {
          local_48 = this + 0x44;
          if (uVar4 >> 0xc != *(uint *)(puVar6 + 8)) goto LAB_004bf6f9;
          iVar5 = *(int *)(puVar6 + 4);
        }
        if (iVar5 == 0) goto LAB_004bf6f9;
        if (*(int *)(iVar5 + 0x30) == 0) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(iVar5 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
      }
                    /* try { // try from 004bf70f to 004bf713 has its CatchHandler @ 004bf81c */
      CBaseEntity::EmitSound((IRecipientFilter *)(this + 0x60),iVar5,(EmitSound_t *)&local_60);
      *(undefined4 *)(this + 0x50) = 0;
      uVar7 = 1;
      local_28 = 0;
      CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
      local_24 = local_34;
      CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
      goto LAB_004bf47a;
    }
    puVar3 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x30) != (undefined1 *)0x0) {
      puVar3 = *(undefined1 **)(this + 0x30);
    }
                    /* try { // try from 004bf473 to 004bf477 has its CatchHandler @ 004bf80c */
    DevWarning("CSoundPatch::Update:  Removing CSoundPatch (%s) with NULL EHandle\n",puVar3);
  }
  else if (*(int *)(this + 0x58) != 0) {
                    /* try { // try from 004bf4e9 to 004bf4ed has its CatchHandler @ 004bf80c */
    Shutdown(in_stack_ffffff44);
  }
  uVar7 = 0;
LAB_004bf47a:
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar2 = ThreadGetCurrentId(), iVar5 == iVar2)) {
    cVar1 = CVProfNode::ExitScope();
    if (cVar1 != '\0') {
      _DAT_0105d15c = *(CSoundPatch **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CSoundPatch *)0x105d160;
  }
  if (local_64 != (CSoundPatch *)0x0) {
    (**(code **)(local_64 + 0x54))(local_64,local_6c,local_68,0,0,0);
  }
  return uVar7;
}

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)