L L4D2node

CFuncTrackTrain::SoundUpdate

0x00b0f790 · 1602 bytes · __thiscall

_ZN15CFuncTrackTrain11SoundUpdateEv

Decompiled

undefined (1 param)

/* CFuncTrackTrain::SoundUpdate() */

void __thiscall CFuncTrackTrain::SoundUpdate(CFuncTrackTrain *this)

{
  char cVar1;
  undefined4 *puVar2;
  int iVar3;
  float fVar4;
  float local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined **local_a0 [8];
  undefined **local_80 [8];
  undefined4 local_60;
  int local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  int local_4c;
  undefined4 *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;
  
  if (((*(int *)(this + 0x48c) != 0) || (*(int *)(this + 0x494) != 0)) ||
     (*(int *)(this + 0x490) != 0)) {
    cVar1 = (**(code **)(*g_pGameRules + 0x88))(g_pGameRules);
    if ((cVar1 != '\0') && (this[0x4b8] != (CFuncTrackTrain)0x0)) {
      if (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x504)) {
        return;
      }
      *(float *)(this + 0x504) = *(float *)(gpGlobals + 0xc) + 1.0;
    }
    if (((byte)this[0x149] & 1) == 0) {
      local_b0 = ABS(*(float *)(this + 0x11c)) * 0.001;
      if (1.0 <= local_b0) {
        local_b0 = 1.0;
      }
    }
    else {
      local_b0 = ABS(*(float *)(this + 0x11c)) / *(float *)(this + 0x484);
      if (local_b0 <= 1.0) {
        if (local_b0 <= 0.0) {
          local_b0 = 0.0;
        }
      }
      else {
        local_b0 = 1.0;
      }
    }
    fVar4 = (float)*(int *)(this + 0x4a8) +
            ((float)*(int *)(this + 0x4ac) - (float)*(int *)(this + 0x4a8)) * local_b0;
    (**(code **)(*(int *)this + 0x28c))((Vector *)&local_60,this);
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_a0);
    local_a0[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00b0f8a0 to 00b0f8a4 has its CatchHandler @ 00b0fe58 */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_a0,(Vector *)&local_60);
    local_a0[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00b0f8b8 to 00b0f8da has its CatchHandler @ 00b0fe56 */
    (**(code **)(*(int *)this + 0x28c))((Vector *)&local_60,this);
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_a0,(Vector *)&local_60,0.8);
                    /* try { // try from 00b0f8e4 to 00b0f8f7 has its CatchHandler @ 00b0fe52 */
    (**(code **)(*(int *)this + 0x28c))((Vector *)&local_60,this);
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00b0f906 to 00b0f90a has its CatchHandler @ 00b0fe44 */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
    local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00b0f91b to 00b0f937 has its CatchHandler @ 00b0fe35 */
    (**(code **)(*(int *)this + 0x28c))((Vector *)&local_60,this);
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
                    /* try { // try from 00b0f93b to 00b0f94a has its CatchHandler @ 00b0fe31 */
    CRecipientFilter::MakeReliable((CRecipientFilter *)local_80);
    puVar2 = (undefined4 *)(**(code **)(*(int *)this + 0x288))(this);
    local_ac = *puVar2;
    local_a8 = puVar2[1];
    local_a4 = puVar2[2];
    if (this[0x4b8] == (CFuncTrackTrain)0x0) {
      if (*(int *)(this + 0x494) != 0) {
        local_48 = &local_ac;
        local_58 = *(undefined4 *)(this + 0x470);
        local_50 = 0;
        local_4c = 100;
        local_44 = 0;
        local_40 = 0;
        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;
        local_20 = 0xffff;
        local_60 = 3;
        local_54 = 0x4b;
        if (*(int *)(this + 0x30) == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        local_5c = *(int *)(this + 0x494);
                    /* try { // try from 00b0fa2a to 00b0fa2e has its CatchHandler @ 00b0fe37 */
        CBaseEntity::EmitSound((IRecipientFilter *)local_a0,iVar3,(EmitSound_t *)&local_60);
        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);
      }
      if (*(int *)(this + 0x48c) != 0) {
        local_58 = *(undefined4 *)(this + 0x470);
        local_50 = 0;
        local_44 = 0;
        local_4c = (int)fVar4;
        local_40 = 0;
        local_3c = 1;
        local_3b = 0;
        local_3a = 0;
        local_48 = &local_ac;
        local_38 = 0xffffffff;
        local_34 = 0;
        local_30 = 0;
        local_2c = 0;
        local_28 = 0;
        local_24 = 0;
        local_20 = 0xffff;
        local_60 = 6;
        local_54 = 0x4b;
        if (*(int *)(this + 0x30) == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        local_5c = *(int *)(this + 0x48c);
                    /* try { // try from 00b0fb15 to 00b0fb19 has its CatchHandler @ 00b0fe42 */
        CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar3,(EmitSound_t *)&local_60);
        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);
      }
      fVar4 = *(float *)(gpGlobals + 0xc);
      this[0x4b8] = (CFuncTrackTrain)0x1;
      *(float *)(this + 0x4a4) =
           fVar4 + *(float *)(this + 0x4a0) +
           (*(float *)(this + 0x49c) - *(float *)(this + 0x4a0)) * local_b0;
    }
    else {
      if (*(int *)(this + 0x48c) != 0) {
        local_58 = *(undefined4 *)(this + 0x470);
        local_44 = 0;
        local_40 = 0;
        local_4c = (int)fVar4;
        local_3c = 1;
        local_3b = 0;
        local_3a = 0;
        local_38 = 0xffffffff;
        local_48 = &local_ac;
        local_34 = 0;
        local_30 = 0;
        local_2c = 0;
        local_28 = 0;
        local_24 = 0;
        local_20 = 0xffff;
        local_60 = 6;
        local_54 = 0x4b;
        local_50 = 2;
                    /* try { // try from 00b0fcb2 to 00b0fce6 has its CatchHandler @ 00b0fdf5 */
        local_5c = *(int *)(this + 0x48c);
        cVar1 = (**(code **)(*g_pGameRules + 0x88))(g_pGameRules);
        iVar3 = *(int *)(this + 0x30);
        if (cVar1 == '\0') {
          if (iVar3 == 0) {
            iVar3 = 0;
          }
          else {
            iVar3 = iVar3 - *(int *)(gpGlobals + 0x58) >> 4;
          }
          CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar3,(EmitSound_t *)&local_60);
        }
        else {
          if (iVar3 == 0) {
            iVar3 = 0;
          }
          else {
            iVar3 = iVar3 - *(int *)(gpGlobals + 0x58) >> 4;
          }
                    /* try { // try from 00b0fda9 to 00b0fdad has its CatchHandler @ 00b0fdf5 */
          CBaseEntity::EmitSound((IRecipientFilter *)local_a0,iVar3,(EmitSound_t *)&local_60);
        }
        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);
      }
      if ((*(char **)(this + 0x490) != (char *)0x0) &&
         (*(float *)(this + 0x4a4) <= *(float *)(gpGlobals + 0xc) &&
          *(float *)(gpGlobals + 0xc) != *(float *)(this + 0x4a4))) {
                    /* try { // try from 00b0fd44 to 00b0fd48 has its CatchHandler @ 00b0fe31 */
        CBaseEntity::EmitSound((CBaseEntity *)this,*(char **)(this + 0x490),0.0,(float *)0x0);
        *(float *)(this + 0x4a4) =
             *(float *)(gpGlobals + 0xc) + *(float *)(this + 0x4a0) +
             (*(float *)(this + 0x49c) - *(float *)(this + 0x4a0)) * local_b0;
      }
    }
    local_80[0] = &PTR__CPASFilter_00bfaf28;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
    local_a0[0] = &PTR__CPASFilter_00bfaf28;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_a0);
  }
  return;
}

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)