L L4D2node

CTerrorPlayer::StopTrackedSound

0x009ac130 · 225 bytes · __thiscall

_ZN13CTerrorPlayer16StopTrackedSoundEPKc

Decompiled

undefined (2 params)

/* CTerrorPlayer::StopTrackedSound(char const*) */

void __thiscall CTerrorPlayer::StopTrackedSound(CTerrorPlayer *this,char *param_1)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  char *pcVar4;
  int *piVar5;
  undefined4 *puVar6;
  int iVar7;
  
  pcVar4 = (char *)0x0;
  if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
    pcVar4 = param_1;
  }
  iVar3 = *(int *)(this + 0x2b54);
  if (iVar3 < 1) {
    return;
  }
  piVar5 = *(int **)(this + 0x2b48);
  if (pcVar4 == (char *)*piVar5) {
    iVar7 = 0;
    iVar2 = 0;
  }
  else {
    iVar2 = 0;
    do {
      piVar5 = piVar5 + 2;
      iVar2 = iVar2 + 1;
      if (iVar2 == iVar3) {
        return;
      }
      iVar7 = iVar2 * 8;
    } while (pcVar4 != (char *)*piVar5);
    if (iVar2 == -1) {
      return;
    }
  }
  if (((float)piVar5[1] == 0.0) || (*(float *)(gpGlobals + 0xc) <= (float)piVar5[1])) {
    CBaseEntity::StopSound((CBaseEntity *)this,param_1);
    iVar3 = *(int *)(this + 0x2b54);
    if (iVar3 < 1) {
      return;
    }
  }
  iVar3 = iVar3 + -1;
  if (iVar2 != iVar3) {
    puVar6 = (undefined4 *)(iVar7 + *(int *)(this + 0x2b48));
    puVar1 = (undefined4 *)(*(int *)(this + 0x2b48) + iVar3 * 8);
    *puVar6 = *puVar1;
    puVar6[1] = puVar1[1];
    iVar3 = *(int *)(this + 0x2b54) + -1;
  }
  *(int *)(this + 0x2b54) = iVar3;
  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)