L L4D2node

CBaseServerVehicle::PlayCrashSound

0x00b3a680 · 476 bytes · __thiscall

_ZN18CBaseServerVehicle14PlayCrashSoundEf

Decompiled

undefined (2 params)

/* CBaseServerVehicle::PlayCrashSound(float) */

undefined4 __thiscall CBaseServerVehicle::PlayCrashSound(CBaseServerVehicle *this,float param_1)

{
  int iVar1;
  CBaseEntity *this_00;
  int iVar2;
  int iVar3;
  float *pfVar4;
  char *pcVar5;
  float fVar6;
  float fVar7;
  char *pcVar8;
  CBaseServerVehicle *in_stack_ffffffc4;
  char *in_stack_ffffffc8;
  
  fVar7 = ABS(*(float *)(this + 0x19c));
  if (fVar7 <= ABS(param_1)) {
    fVar6 = 0.0;
  }
  else {
    fVar6 = ABS(*(float *)(this + 0x19c) - param_1);
    pcVar8 = (char *)(fVar6 * 0.125);
    if (60.0 <= (float)pcVar8) {
      pcVar8 = (char *)0x42700000;
    }
    if ((5.0 < (float)pcVar8) &&
       (in_stack_ffffffc4 = this, iVar1 = (**(code **)(*(int *)this + 0xf0))(), iVar1 != 0)) {
      this_00 = (CBaseEntity *)(**(code **)(*(int *)this + 0xf0))(this);
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      in_stack_ffffffc4 = (CBaseServerVehicle *)(this_00 + 0x2e0);
      UTIL_ScreenShake(in_stack_ffffffc4,pcVar8,0x43160000,0x3f800000,0x43700000,4,1,0);
      in_stack_ffffffc8 = pcVar8;
    }
  }
  iVar1 = *(int *)(this + 0xb4);
  if (0 < iVar1) {
    iVar3 = *(int *)(this + 0xa8);
    iVar2 = 0;
    do {
      if ((((*(int *)(iVar3 + 0xc) != 0) && (*(int *)(this + 0x184) <= *(int *)(iVar3 + 0xc))) &&
          (*(float *)(iVar3 + 8) <= fVar6 && fVar6 != *(float *)(iVar3 + 8))) &&
         (*(float *)(iVar3 + 4) <= fVar7 && fVar7 != *(float *)(iVar3 + 4))) {
        pcVar8 = *(char **)(iVar3 + 0x10);
        goto LAB_00b3a813;
      }
      iVar2 = iVar2 + 1;
      iVar3 = iVar3 + 0x14;
    } while (iVar2 != iVar1);
  }
  iVar1 = iVar1 + -1;
  if (-1 < iVar1) {
    pfVar4 = (float *)(*(int *)(this + 0xa8) + 8 + iVar1 * 0x14);
    do {
      if ((*pfVar4 <= fVar6 && fVar6 != *pfVar4) && (pfVar4[-1] <= fVar7 && fVar7 != pfVar4[-1])) {
        pcVar8 = (char *)pfVar4[2];
LAB_00b3a813:
        pcVar5 = "";
        if (pcVar8 != (char *)0x0) {
          pcVar5 = pcVar8;
        }
        if (*pcVar5 == '\0') {
          return 1;
        }
        PlaySound(in_stack_ffffffc4,in_stack_ffffffc8);
        return 1;
      }
      iVar1 = iVar1 + -1;
      pfVar4 = pfVar4 + -5;
    } while (iVar1 != -1);
  }
  return 0;
}

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)