L L4D2node

CBaseServerVehicle::RecalculateSoundGear

0x00b36320 · 97 bytes · __thiscall

_ZN18CBaseServerVehicle20RecalculateSoundGearER18vbs_sound_update_t

Decompiled

undefined (2 params)

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

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

{
  float fVar1;
  float fVar2;
  int iVar4;
  float *pfVar5;
  float fVar3;
  
  iVar4 = *(int *)(this + 0xa0) + -1;
  if (-1 < iVar4) {
    fVar1 = *(float *)(this + 0x188);
    pfVar5 = (float *)(*(int *)(this + 0x94) + 4 + iVar4 * 0x10);
    if (fVar1 < *pfVar5 || fVar1 == *pfVar5) {
      pfVar5 = (float *)(*(int *)(this + 0x94) + -0xc + iVar4 * 0x10);
      do {
        iVar4 = iVar4 + -1;
        if (iVar4 == -1) goto LAB_00b36369;
        fVar2 = *pfVar5;
        fVar3 = *pfVar5;
        pfVar5 = pfVar5 + -4;
      } while (fVar1 < fVar3 || fVar1 == fVar2);
    }
    *(int *)(this + 0x184) = iVar4;
  }
LAB_00b36369:
  if (param_1[0xd] != (vbs_sound_update_t)0x0) {
    *(undefined4 *)(this + 0x184) = 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)