L L4D2node

CBaseServerVehicle::PlaySound

0x00b3bda0 · 421 bytes · __thiscall

_ZN18CBaseServerVehicle9PlaySoundE12vehiclesound

Decompiled

undefined (2 params)

/* CBaseServerVehicle::PlaySound(vehiclesound) */

void __thiscall CBaseServerVehicle::PlaySound(CBaseServerVehicle *this,int param_2)

{
  int *piVar1;
  int iVar2;
  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;
  
  if (*(int *)(this + param_2 * 4 + 0xbc) != 0) {
    piVar1 = *(int **)(this + 0x2c);
    (**(code **)(*piVar1 + 0x28c))((Vector *)&local_60,piVar1);
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00b3bdfb to 00b3bdff has its CatchHandler @ 00b3bf4c */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
    local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00b3be10 to 00b3be2c has its CatchHandler @ 00b3bf97 */
    (**(code **)(*piVar1 + 0x28c))((Vector *)&local_60,piVar1);
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
    local_3c = 1;
    local_20 = 0xffff;
    local_50 = 0;
    local_4c = 100;
    local_3b = 0;
    local_48 = 0;
    local_44 = 0;
    local_40 = 0;
    local_3a = 0;
    local_5c = &DAT_00d539c2;
    if (*(undefined1 **)(this + param_2 * 4 + 0xbc) != (undefined1 *)0x0) {
      local_5c = *(undefined1 **)(this + param_2 * 4 + 0xbc);
    }
    local_38 = 0xffffffff;
    local_34 = 0;
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    local_58 = *(undefined4 *)(this + 0x180);
    local_24 = 0;
    local_60 = 2;
    local_54 = 0x4b;
    if (*(int *)(*(int *)(this + 0x2c) + 0x30) == 0) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(*(int *)(this + 0x2c) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
                    /* try { // try from 00b3bee4 to 00b3bf42 has its CatchHandler @ 00b3bf5e */
    CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar2,(EmitSound_t *)&local_60);
    if (*(int *)(g_debug_vehiclesound._28_4_ + 0x30) != 0) {
      Msg("Playing vehicle sound: %s\n",local_5c);
    }
    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);
  }
  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)