L L4D2node

PhysFrictionSound

0x0077cb30 · 919 bytes · __cdecl

_Z17PhysFrictionSoundP11CBaseEntityP14IPhysicsObjectPKcRsf

Decompiled

undefined (5 params)

/* PhysFrictionSound(CBaseEntity*, IPhysicsObject*, char const*, short&, float) */

void PhysFrictionSound(CBaseEntity *param_1,IPhysicsObject *param_2,char *param_3,short *param_4,
                      float param_5)

{
  char cVar1;
  undefined4 *puVar2;
  int *piVar3;
  undefined4 uVar4;
  int iVar5;
  undefined1 *puVar6;
  undefined1 *puVar7;
  undefined4 *puVar8;
  int in_GS_OFFSET;
  float local_10c;
  Vector local_f4 [12];
  undefined **local_e8 [8];
  undefined4 local_c8;
  float local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  int local_b4;
  undefined1 local_b0;
  undefined4 local_ac;
  undefined1 local_a8;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  puVar6 = &stack0xfffffed4;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  puVar7 = &stack0xfffffed4;
  if (param_1 != (CBaseEntity *)0x0) {
    if (param_5 <= 0.0) {
      param_5 = 0.0;
    }
    if (1.0 <= param_5) {
      param_5 = 1.0;
    }
    puVar7 = &stack0xfffffed4;
    if (0.0078125 < param_5) {
      puVar2 = (undefined4 *)(g_Collisions + 0xc);
      puVar8 = (undefined4 *)0x0;
      iVar5 = 0;
      do {
        if ((CBaseEntity *)puVar2[1] == (CBaseEntity *)0x0) {
          if (puVar8 == (undefined4 *)0x0) {
            puVar8 = puVar2;
          }
        }
        else if (param_1 == (CBaseEntity *)puVar2[1]) {
          puVar8 = (undefined4 *)(g_Collisions + iVar5 * 0x10 + 0xc);
          goto LAB_0077cbb7;
        }
        iVar5 = iVar5 + 1;
        puVar2 = puVar2 + 4;
      } while (iVar5 != 4);
      puVar7 = &stack0xfffffed4;
      if (puVar8 != (undefined4 *)0x0) {
LAB_0077cbb7:
        local_c8 = 0;
        local_c4 = 1.0;
        local_c0 = 100;
        local_bc = 100;
        local_b8 = 100;
        local_b4 = 0x4b;
        local_a8 = 0;
        local_b0 = 0;
        local_ac = 0;
        local_28 = 0;
        local_24 = 0;
        cVar1 = CBaseEntity::GetParametersForSound
                          (param_3,param_4,(CSoundParameters *)&local_c8,(char *)0x0);
        iVar5 = local_b4;
        puVar7 = &stack0xfffffed4;
        if (cVar1 != '\0') {
          if (puVar8[1] == 0) {
            puVar7 = &stack0xfffffed4;
            if (param_5 * local_c4 <= 0.1) goto LAB_0077ccf0;
            puVar8[1] = param_1;
            (**(code **)(*(int *)param_1 + 0x28c))();
            CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_e8);
            local_e8[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 0077cd99 to 0077cd9d has its CatchHandler @ 0077ced5 */
            CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_e8,local_f4);
            local_e8[0] = &PTR__CPASAttenuationFilter_00c08ec8;
            local_10c = 4.0;
            if (0x32 < iVar5) {
              local_10c = 20.0 / (float)(iVar5 + -0x32);
            }
                    /* try { // try from 0077cdf1 to 0077ce19 has its CatchHandler @ 0077cf03 */
            (**(code **)(*(int *)param_1 + 0x28c))();
            puVar6 = &stack0xfffffecc;
            CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_e8,local_f4,local_10c);
                    /* try { // try from 0077ce1a to 0077ceb0 has its CatchHandler @ 0077cee7 */
            piVar3 = (int *)CSoundEnvelopeController::GetController();
            uVar4 = (**(code **)(*piVar3 + 0x24))();
            *puVar8 = uVar4;
            piVar3 = (int *)CSoundEnvelopeController::GetController();
            (**(code **)(*piVar3 + 8))();
            local_e8[0] = &PTR__CPASFilter_00bfaf28;
            CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_e8);
          }
          else {
            piVar3 = (int *)CSoundEnvelopeController::GetController();
            (**(code **)(*piVar3 + 0x34))();
            piVar3 = (int *)CSoundEnvelopeController::GetController();
            (**(code **)(*piVar3 + 0x30))();
          }
          iVar5 = gpGlobals;
          puVar8[2] = *(undefined4 *)(gpGlobals + 0xc);
          puVar8[3] = *(undefined4 *)(iVar5 + 0xc);
          puVar7 = puVar6;
        }
      }
    }
  }
LAB_0077ccf0:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined1 **)(puVar7 + -4) = &LAB_0077ced5;
  __stack_chk_fail();
}

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)