L L4D2node

CBaseServerVehicle::SoundUpdate

0x00b3aef0 · 317 bytes · __thiscall

_ZN18CBaseServerVehicle11SoundUpdateER18vbs_sound_update_t

Decompiled

undefined (2 params)

/* CBaseServerVehicle::SoundUpdate(vbs_sound_update_t&) */

void __thiscall
CBaseServerVehicle::SoundUpdate(CBaseServerVehicle *this,vbs_sound_update_t *param_1)

{
  float fVar1;
  undefined4 uVar2;
  char *pcVar3;
  longdouble lVar4;
  float fVar5;
  
  if (*(int *)(g_debug_vehiclesound._28_4_ + 0x30) < 2) {
    fVar5 = *(float *)(param_1 + 4);
  }
  else {
    pcVar3 = "on";
    if (param_1[0xc] == (vbs_sound_update_t)0x0) {
      pcVar3 = "off";
    }
    Msg("Throttle: %s, Reverse: %s\n",pcVar3);
    fVar5 = *(float *)(param_1 + 4);
    if (1 < *(int *)(g_debug_vehiclesound._28_4_ + 0x30)) {
      Msg("CurrentSpeed: %.3f  ",(double)fVar5);
    }
  }
  if ((0 < *(int *)(this + 0xa0)) && (fVar1 = *(float *)(this + 0x188), fVar1 < fVar5)) {
    if (param_1[0xc] == (vbs_sound_update_t)0x0) {
      fVar5 = fVar1;
    }
    lVar4 = (longdouble)
            Approach(fVar5,fVar1,
                     *(float *)(*(int *)(this + 0x184) * 0x10 + *(int *)(this + 0x94) + 0xc) *
                     *(float *)param_1);
    fVar5 = (float)lVar4;
  }
  uVar2 = g_debug_vehiclesound._28_4_;
  if (fVar5 <= 0.0) {
    fVar5 = 0.0;
  }
  if (1.0 <= fVar5) {
    fVar5 = 1.0;
  }
  *(float *)(this + 0x188) = fVar5;
  if (1 < *(int *)(uVar2 + 0x30)) {
    Msg("Sound Speed: %.3f\n",(double)fVar5);
  }
  (**(code **)(*(int *)this + 0x118))(this,param_1);
  SoundState_Update(this,param_1);
  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)