L L4D2node

CAmbientGeneric::SendSound

0x005dc550 · 544 bytes · __thiscall

_ZN15CAmbientGeneric9SendSoundE12SoundFlags_t

Decompiled

undefined (2 params)

/* CAmbientGeneric::SendSound(SoundFlags_t) */

void __thiscall CAmbientGeneric::SendSound(CAmbientGeneric *this,int param_2)

{
  uint uVar1;
  CBaseEntity *this_00;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  undefined *puVar6;
  undefined1 *puVar7;
  
  puVar7 = &DAT_00d539c2;
  if (*(undefined1 **)(this + 0x4b4) != (undefined1 *)0x0) {
    puVar7 = *(undefined1 **)(this + 0x4b4);
  }
  uVar1 = *(uint *)(this + 0x4bc);
  if ((((uVar1 != 0xffffffff) &&
       (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
     (this_00 = *(CBaseEntity **)(puVar6 + 4), this_00 != (CBaseEntity *)0x0)) {
    if (param_2 != 4) {
      iVar5 = *(int *)(this + 0x498);
      uVar2 = *(undefined4 *)(this + 0x488);
      uVar3 = *(undefined4 *)(this + 0x448);
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      if (*(int *)(this_00 + 0x30) == 0) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      UTIL_EmitAmbientSound
                (iVar4,this_00 + 0x2e0,puVar7,(float)iVar5 * 0.01,uVar3,param_2,uVar2,0,0);
      return;
    }
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    if (*(int *)(this_00 + 0x30) == 0) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    UTIL_EmitAmbientSound(iVar5,this_00 + 0x2e0,puVar7,0,0,4,0,0,0);
    return;
  }
  if ((param_2 == 4) && (iVar5 = *(int *)(this + 0x4c0), iVar5 != -1)) {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      iVar5 = *(int *)(this + 0x4c0);
    }
    UTIL_EmitAmbientSound(iVar5,this + 0x2e0,puVar7,0,0,4,0,0,0);
  }
  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)