L L4D2node

CChainsaw::StartSound

0x00531e40 · 293 bytes · __thiscall

_ZN9CChainsaw10StartSoundEPP11CSoundPatchPKc

Decompiled

undefined (3 params)

/* CChainsaw::StartSound(CSoundPatch**, char const*) */

void __thiscall CChainsaw::StartSound(CChainsaw *this,CSoundPatch **param_1,char *param_2)

{
  int *piVar1;
  CSoundPatch *pCVar2;
  int iVar3;
  Vector local_48 [12];
  undefined **local_3c [11];
  
  piVar1 = *(int **)(this + 0x1804);
  if (piVar1 != (int *)0x0) {
    if (*param_1 != (CSoundPatch *)0x0) {
      StopSound(this,param_1,0.0);
      piVar1 = *(int **)(this + 0x1804);
    }
    (**(code **)(*piVar1 + 0x28c))(local_48,piVar1);
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
    local_3c[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00531eb1 to 00531eb5 has its CatchHandler @ 00531f6c */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_3c,local_48);
    local_3c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00531ec6 to 00531ee2 has its CatchHandler @ 00531f97 */
    (**(code **)(*piVar1 + 0x28c))(local_48,piVar1);
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_3c,local_48,0.8);
                    /* try { // try from 00531ee3 to 00531f49 has its CatchHandler @ 00531f7e */
    piVar1 = (int *)CSoundEnvelopeController::GetController();
    if (*(int *)(this + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    pCVar2 = (CSoundPatch *)
             (**(code **)(*piVar1 + 0x18))(piVar1,(CRecipientFilter *)local_3c,iVar3,param_2);
    *param_1 = pCVar2;
    piVar1 = (int *)CSoundEnvelopeController::GetController();
    (**(code **)(*piVar1 + 8))(piVar1,*param_1,0x3f800000,0x42c80000,0);
    local_3c[0] = &PTR__CPASFilter_00bfaf28;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
  }
  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)