L L4D2node

CSoundControllerImp::SoundPlayEnvelope

0x004bdce0 · 357 bytes · __thiscall

_ZN19CSoundControllerImp17SoundPlayEnvelopeEP11CSoundPatch15soundcommands_tP15envelopePoint_ti

Decompiled

undefined (5 params)

/* CSoundControllerImp::SoundPlayEnvelope(CSoundPatch*, soundcommands_t, envelopePoint_t*, int) */

longdouble __thiscall
CSoundControllerImp::SoundPlayEnvelope
          (CSoundControllerImp *this,undefined4 param_1,undefined4 param_3,float *param_4,
          int param_5)

{
  int iVar1;
  longdouble lVar2;
  float local_28;
  float local_24;
  float local_20;
  
  (**(code **)(*(int *)this + 0x10))(this,param_1);
  if (param_5 < 1) {
    local_20 = 0.0;
  }
  else {
    iVar1 = 0;
    local_20 = 0.0;
    local_24 = 0.0;
    local_28 = 0.0;
    do {
      if ((*param_4 == -1.0) && (param_4[1] == -1.0)) {
        if (iVar1 == 0) {
          Msg("Invalid starting amplitude value in envelope!  (Cannot be -1)\n");
        }
      }
      else {
        lVar2 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,*param_4,param_4[1]);
        local_28 = (float)lVar2;
      }
      if ((param_4[2] == -1.0) && (param_4[3] == -1.0)) {
        if (iVar1 == 0) {
          Msg("Invalid starting duration value in envelope! (Cannot be -1)\n");
        }
      }
      else {
        lVar2 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,param_4[2],param_4[3]);
        local_24 = (float)lVar2;
      }
      iVar1 = iVar1 + 1;
      param_4 = param_4 + 4;
      (**(code **)(*(int *)this + 0xc))(this,param_1,local_20,param_3,local_24,local_28);
      local_20 = local_20 + local_24;
    } while (iVar1 != param_5);
  }
  return (longdouble)local_20;
}

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)