L L4D2node

CTankTrainAI::SoundEngineStart

0x00836b70 · 758 bytes · __thiscall

_ZN12CTankTrainAI16SoundEngineStartEv

Decompiled

undefined (1 param)

/* CTankTrainAI::SoundEngineStart() */

void __thiscall CTankTrainAI::SoundEngineStart(CTankTrainAI *this)

{
  uint uVar1;
  int iVar2;
  code *pcVar3;
  undefined4 uVar4;
  code *pcVar5;
  int iVar6;
  undefined *puVar7;
  undefined4 *puVar8;
  int *piVar9;
  CTankTrainAI *in_stack_ffffff54;
  undefined **local_80 [8];
  undefined4 local_60;
  undefined1 *local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 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;
  
  piVar9 = (int *)0x0;
  puVar8 = (undefined4 *)&stack0xffffff54;
  uVar1 = *(uint *)(this + 0x440);
  if (((uVar1 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
    piVar9 = *(int **)(puVar7 + 4);
  }
  if (*(int *)(this + 0x448) != 0) {
    SoundEngineStop(in_stack_ffffff54);
  }
  if (*(int *)(this + 0x454) != 0) {
    (**(code **)(*piVar9 + 0x28c))();
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00836bff to 00836c03 has its CatchHandler @ 00836ec9 */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
    local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00836c17 to 00836c36 has its CatchHandler @ 00836e77 */
    (**(code **)(*piVar9 + 0x28c))();
    puVar8 = (undefined4 *)&stack0xffffff4c;
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
    local_3c = 1;
    local_20 = 0xffff;
    local_58 = 0x3f800000;
    local_50 = 0;
    local_4c = 100;
    local_5c = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x454) != (undefined1 *)0x0) {
      local_5c = *(undefined1 **)(this + 0x454);
    }
    local_48 = 0;
    local_44 = 0;
    local_40 = 0;
    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_60 = 3;
    local_54 = 0x4b;
    if (piVar9[0xc] == 0) {
      iVar6 = 0;
    }
    else {
      iVar6 = piVar9[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
    }
                    /* try { // try from 00836ce6 to 00836cea has its CatchHandler @ 00836e90 */
    CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar6,(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);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
  }
  puVar8[-1] = 0x836d1f;
  piVar9 = (int *)CSoundEnvelopeController::GetController();
  iVar6 = *(int *)(this + 0x44c);
  if (iVar6 != 0) {
    iVar2 = *piVar9;
    puVar8[4] = 0;
    puVar8[3] = 0x42c80000;
    puVar8[2] = 0x3f800000;
    puVar8[1] = iVar6;
    *puVar8 = piVar9;
    pcVar3 = *(code **)(iVar2 + 8);
    puVar8[-1] = 0x836d4f;
    (*pcVar3)();
  }
  if (*(int *)(this + 0x450) != 0) {
    iVar6 = *piVar9;
    puVar8[1] = *(int *)(this + 0x450);
    puVar8[4] = 0;
    puVar8[3] = 0x42b40000;
    puVar8[2] = 0x3f000000;
    *puVar8 = piVar9;
    pcVar3 = *(code **)(iVar6 + 8);
    puVar8[-1] = 0x836d81;
    (*pcVar3)();
    uVar4 = *(undefined4 *)(this + 0x450);
    iVar6 = *piVar9;
    *puVar8 = piVar9;
    puVar8[1] = uVar4;
    pcVar3 = *(code **)(iVar6 + 0x10);
    puVar8[-1] = 0x836d93;
    (*pcVar3)();
    pcVar3 = *(code **)(*piVar9 + 0xc);
    iVar6 = *random_valve;
    puVar8[2] = 0x91;
    puVar8[1] = 0x82;
    *puVar8 = random_valve;
    pcVar5 = *(code **)(iVar6 + 8);
    puVar8[-1] = 0x836db5;
    iVar6 = (*pcVar5)();
    puVar8[4] = 0x3fc00000;
    puVar8[3] = 1;
    puVar8[2] = 0;
    puVar8[5] = (float)iVar6;
    uVar4 = *(undefined4 *)(this + 0x450);
    *puVar8 = piVar9;
    puVar8[1] = uVar4;
    puVar8[-1] = 0x836de6;
    (*pcVar3)();
    pcVar3 = *(code **)(*piVar9 + 0xc);
    iVar6 = *random_valve;
    puVar8[2] = 0x73;
    puVar8[1] = 0x69;
    *puVar8 = random_valve;
    pcVar5 = *(code **)(iVar6 + 8);
    puVar8[-1] = 0x836e08;
    iVar6 = (*pcVar5)();
    puVar8[4] = 0x40000000;
    puVar8[3] = 1;
    puVar8[2] = 0x3fc00000;
    puVar8[5] = (float)iVar6;
    uVar4 = *(undefined4 *)(this + 0x450);
    *puVar8 = piVar9;
    puVar8[1] = uVar4;
    puVar8[-1] = 0x836e39;
    (*pcVar3)();
  }
  *(undefined4 *)(this + 0x448) = 1;
  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)