L L4D2node

CBasePlayer::UpdateStepSound

0x00416690 · 922 bytes · __thiscall

_ZN11CBasePlayer15UpdateStepSoundEP13surfacedata_tRK6VectorS4_

Decompiled

undefined (4 params)

/* CBasePlayer::UpdateStepSound(surfacedata_t*, Vector const&, Vector const&) */

void __thiscall
CBasePlayer::UpdateStepSound
          (CBasePlayer *this,surfacedata_t *param_1,Vector *param_2,Vector *param_3)

{
  CBasePlayer CVar1;
  code *pcVar2;
  bool bVar3;
  undefined4 uVar4;
  float fVar5;
  float fVar6;
  float local_48;
  float local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined1 local_34 [12];
  undefined1 local_28 [24];
  
  if (0.0 < *(float *)(this + 0x1ff0)) {
    fVar6 = *(float *)(this + 0x1ff0) - *(float *)(gpGlobals + 0x10) * 1000.0;
    *(float *)(this + 0x1ff0) = fVar6;
    if (fVar6 < 0.0) {
      *(undefined4 *)(this + 0x1ff0) = 0;
    }
    else if (0.0 < fVar6) {
      return;
    }
  }
  if (((((byte)this[0x150] & 0x60) == 0) && (CVar1 = this[0x186], ((byte)CVar1 & 0xfd) != 8)) &&
     (*(float *)(sv_footsteps._28_4_ + 0x2c) != 0.0)) {
    fVar6 = *(float *)param_3 * *(float *)param_3 +
            *(float *)(param_3 + 4) * *(float *)(param_3 + 4);
    fVar5 = SQRT(*(float *)(param_3 + 8) * *(float *)(param_3 + 8) + fVar6);
    (**(code **)(*(int *)this + 0x60c))(this,&local_44,&local_48);
    if ((local_44 <= fVar5) &&
       ((CVar1 == (CBasePlayer)0x9 ||
        ((0.0001 < SQRT(fVar6) && ((*(uint *)(this + 0x150) & 1) != 0)))))) {
      bVar3 = fVar5 < local_48;
      local_3c = *(undefined4 *)(param_2 + 4);
      local_38 = *(undefined4 *)(param_2 + 8);
      local_40 = *(undefined4 *)param_2;
      (**(code **)(*(int *)this + 0x5b4))(local_34,this);
      (**(code **)(*(int *)this + 0x5b0))(local_28,this);
      if (CVar1 == (CBasePlayer)0x9) {
        param_1 = (surfacedata_t *)(**(code **)(*(int *)this + 0x5e8))(this,param_2);
        (**(code **)(*(int *)this + 0x610))(this,1,bVar3);
        fVar6 = 0.5;
      }
      else if (this[0x253] == (CBasePlayer)0x2) {
        if (UpdateStepSound(surfacedata_t*,Vector_const&,Vector_const&)::iSkipStep == 0) {
          UpdateStepSound(surfacedata_t*,Vector_const&,Vector_const&)::iSkipStep = 1;
          return;
        }
        if (UpdateStepSound(surfacedata_t*,Vector_const&,Vector_const&)::iSkipStep == 3) {
          UpdateStepSound(surfacedata_t*,Vector_const&,Vector_const&)::iSkipStep = 0;
        }
        else {
          UpdateStepSound(surfacedata_t*,Vector_const&,Vector_const&)::iSkipStep =
               UpdateStepSound(surfacedata_t*,Vector_const&,Vector_const&)::iSkipStep + 1;
        }
        pcVar2 = *(code **)(*physprops + 0x18);
        uVar4 = (**(code **)(*physprops + 0x10))(physprops,&DAT_00c0a60c);
        param_1 = (surfacedata_t *)(*pcVar2)(physprops,uVar4);
        (**(code **)(*(int *)this + 0x610))(this,2,bVar3);
        fVar6 = 0.65;
      }
      else if (this[0x253] == (CBasePlayer)0x1) {
        pcVar2 = *(code **)(*physprops + 0x18);
        uVar4 = (**(code **)(*physprops + 0x10))(physprops,"water");
        param_1 = (surfacedata_t *)(*pcVar2)(physprops,uVar4);
        fVar6 = 0.5;
        if (bVar3) {
          fVar6 = 0.2;
        }
        (**(code **)(*(int *)this + 0x610))(this,3,bVar3);
      }
      else {
        if (param_1 == (surfacedata_t *)0x0) {
          return;
        }
        (**(code **)(*(int *)this + 0x610))(this,0,bVar3);
        switch(*(undefined2 *)(param_1 + 0x4c)) {
        case 0x44:
          fVar6 = 0.55;
          if (bVar3) {
            fVar6 = 0.25;
          }
          break;
        default:
          fVar6 = 0.2;
          if (!bVar3) {
            fVar6 = 0.5;
          }
          break;
        case 0x56:
          fVar6 = 0.7;
          if (bVar3) {
            fVar6 = 0.4;
          }
        }
      }
      if (((byte)this[0x150] & 2) != 0) {
        fVar6 = fVar6 * 0.65;
      }
      (**(code **)(*(int *)this + 0x608))(this,&local_40,param_1,fVar6,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)