L L4D2node

CBaseCombatCharacter::PlayFootstepSound

0x0044d2f0 · 2152 bytes · __thiscall

_ZN20CBaseCombatCharacter17PlayFootstepSoundERK6Vectorbbbb

Decompiled

undefined (6 params)

/* CBaseCombatCharacter::PlayFootstepSound(Vector const&, bool, bool, bool, bool) */

void __thiscall
CBaseCombatCharacter::PlayFootstepSound
          (CBaseCombatCharacter *this,Vector *param_1,bool param_2,bool param_3,bool param_4,
          bool param_5)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  short sVar6;
  int in_GS_OFFSET;
  longdouble lVar7;
  float fVar8;
  char *pcVar9;
  code *local_154;
  float local_144;
  float local_140;
  float local_13c;
  float local_138;
  float local_134;
  float local_130;
  CRecipientFilter local_12c [32];
  undefined4 local_10c;
  undefined1 *local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  Vector *local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined1 local_e8;
  undefined1 local_e7;
  undefined1 local_e6;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined2 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined1 local_b0;
  undefined4 local_ac;
  undefined1 local_a8 [128];
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((*(float *)(sv_footsteps._28_4_ + 0x2c) == 0.0) || (((byte)this[0x186] & 0xfd) == 8))
  goto LAB_0044d9b8;
  lVar7 = (longdouble)CountdownTimer::Now();
  if ((((float)lVar7 < *(float *)(this + 0x1a34)) && (!param_5)) ||
     (cVar1 = (**(code **)(*(int *)this + 0x440))(this), cVar1 == '\0')) goto LAB_0044d9b8;
  if (((byte)this[0x14d] & 0x10) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
  }
  fVar8 = 0.0;
  if (param_5) {
    fVar8 = *(float *)(this + 0x27c) * *(float *)(this + 0x27c);
  }
  fVar8 = SQRT(*(float *)(this + 0x274) * *(float *)(this + 0x274) +
               *(float *)(this + 0x278) * *(float *)(this + 0x278) + fVar8);
  if (((fVar8 < 100.0) && (cVar1 = (**(code **)(*(int *)this + 0x16c))(this), cVar1 == '\0')) &&
     (fVar8 * 0.01 < 0.1)) goto LAB_0044d9b8;
  if (this[0x186] == (CBaseCombatCharacter)0x9) {
    iVar3 = *physprops;
    local_154 = *(code **)(iVar3 + 0x18);
    pcVar9 = "ladder";
LAB_0044d45d:
    uVar2 = (**(code **)(iVar3 + 0x10))(physprops,pcVar9);
    iVar3 = (*local_154)(physprops,uVar2);
  }
  else {
    if (param_4) {
      iVar3 = *physprops;
      local_154 = *(code **)(iVar3 + 0x18);
      pcVar9 = "wade";
      goto LAB_0044d45d;
    }
    if (param_3) {
      iVar3 = *physprops;
      local_154 = *(code **)(iVar3 + 0x18);
      pcVar9 = "water";
      goto LAB_0044d45d;
    }
    cVar1 = (**(code **)(*(int *)this + 0x444))(this,fVar8,param_5);
    if (cVar1 == '\0') goto LAB_0044d9b8;
    iVar3 = (**(code **)(*(int *)this + 0x438))(this);
  }
  if (iVar3 != 0) {
    lVar7 = (longdouble)(**(code **)(*(int *)this + 0x448))(this);
    if (fVar8 < (float)lVar7) {
      if (param_2) {
        sVar6 = *(short *)(iVar3 + 0x2c);
      }
      else {
        sVar6 = *(short *)(iVar3 + 0x2e);
      }
    }
    else if (param_2) {
      sVar6 = *(short *)(iVar3 + 0x30);
    }
    else {
      sVar6 = *(short *)(iVar3 + 0x32);
    }
    if (sVar6 != 0) {
      piVar4 = (int *)MoveHelperServer();
      piVar4 = (int *)(**(code **)(*piVar4 + 0x30))(piVar4);
      pcVar9 = (char *)(**(code **)(*piVar4 + 0x1c))(piVar4,sVar6);
      pcVar5 = (char *)(**(code **)(*(int *)this + 0x43c))(this,pcVar9,!param_2,fVar8,param_5);
      local_c8 = 0;
      local_c4 = 0x3f800000;
      local_c0 = 100;
      local_bc = 100;
      local_b8 = 100;
      local_b4 = 0x4b;
      local_a8[0] = 0;
      local_b0 = 0;
      local_ac = 0;
      local_28 = 0;
      local_24 = 0;
      cVar1 = CBaseEntity::GetParametersForSound(pcVar5,(CSoundParameters *)&local_c8,(char *)0x0);
      if ((cVar1 != '\0') ||
         (cVar1 = CBaseEntity::GetParametersForSound
                            (pcVar9,(CSoundParameters *)&local_c8,(char *)0x0), cVar1 != '\0')) {
        fVar8 = *(float *)(sv_footstepinterval._28_4_ + 0x2c);
        lVar7 = (longdouble)CountdownTimer::Now();
        if ((float)lVar7 + fVar8 != *(float *)(this + 0x1a34)) {
          (**(code **)(*(int *)(this + 0x1a2c) + 4))(this + 0x1a2c,this + 0x1a34);
          *(float *)(this + 0x1a34) = (float)lVar7 + fVar8;
        }
        if (fVar8 != *(float *)(this + 0x1a30)) {
          (**(code **)(*(int *)(this + 0x1a2c) + 4))(this + 0x1a2c,this + 0x1a30);
          *(float *)(this + 0x1a30) = fVar8;
        }
        CRecipientFilter::CRecipientFilter(local_12c);
                    /* try { // try from 0044d697 to 0044d6b8 has its CatchHandler @ 0044db67 */
        CRecipientFilter::AddRecipientsByPAS(local_12c,param_1);
        if (1 < *(int *)(gpGlobals + 0x14)) {
          CRecipientFilter::RemoveRecipientsByPVS(local_12c,param_1);
        }
        local_f4 = param_1;
        local_cc = 0xffff;
        local_fc = 0;
        local_f0 = 0;
        local_ec = 0;
        local_10c = local_c8;
        local_108 = local_a8;
        local_e8 = 1;
        local_e7 = 0;
        local_e6 = 0;
        local_100 = local_b4;
        local_e4 = 0xffffffff;
        local_e0 = 0;
        local_dc = 0;
        local_f8 = local_c0;
        local_d8 = 0;
        local_d4 = 0;
        local_d0 = 0;
        local_104 = local_c4;
        if (*(int *)(this + 0x30) == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
                    /* try { // try from 0044d7a8 to 0044d977 has its CatchHandler @ 0044db7f */
        CBaseEntity::EmitSound((IRecipientFilter *)local_12c,iVar3,(EmitSound_t *)&local_10c);
        (**(code **)(*(int *)this + 0x434))(this,param_1,param_2,param_5);
        if ((*(byte *)(sv_showfootsteps._28_4_ + 0x30) & 2) != 0) {
          local_144 = *(float *)param_1;
          local_130 = *(float *)(param_1 + 8) + 5.0;
          local_140 = *(float *)(param_1 + 4);
          local_13c = *(float *)(param_1 + 8) - 5.0;
          local_138 = local_144;
          local_134 = local_140;
          NDebugOverlay::Line((Vector *)&local_144,(Vector *)&local_138,0,0xff,0,true,6.0);
          local_144 = *(float *)param_1;
          local_134 = *(float *)(param_1 + 4) + 5.0;
          local_140 = *(float *)(param_1 + 4) - 5.0;
          local_13c = *(float *)(param_1 + 8);
          local_138 = local_144;
          local_130 = local_13c;
          NDebugOverlay::Line((Vector *)&local_144,(Vector *)&local_138,0,0xff,0,true,6.0);
          local_140 = *(float *)(param_1 + 4);
          local_138 = *(float *)param_1 + 5.0;
          local_144 = *(float *)param_1 - 5.0;
          local_13c = *(float *)(param_1 + 8);
          local_134 = local_140;
          local_130 = local_13c;
          NDebugOverlay::Line((Vector *)&local_144,(Vector *)&local_138,0,0xff,0,true,6.0);
        }
        local_d4 = 0;
        CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_e0);
        local_d0 = local_e0;
        CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_e0);
        CRecipientFilter::~CRecipientFilter(local_12c);
      }
    }
  }
LAB_0044d9b8:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)