L L4D2node

CTerrorPlayer::UpdateNoiseLevel

0x009fc170 · 456 bytes · __thiscall

_ZN13CTerrorPlayer16UpdateNoiseLevelEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateNoiseLevel() */

void __thiscall CTerrorPlayer::UpdateNoiseLevel(CTerrorPlayer *this)

{
  float fVar1;
  char cVar2;
  int in_GS_OFFSET;
  longdouble lVar3;
  float fVar4;
  float fVar5;
  undefined4 local_30;
  undefined4 local_2c;
  float local_28;
  char local_24 [20];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  cVar2 = (**(code **)(*(int *)this + 300))(this);
  if ((cVar2 != '\0') &&
     (((cVar2 = (**(code **)(*(int *)this + 0x550))(this), cVar2 != '\0' ||
       (cVar2 = IsDominatedBySpecialInfected(this), cVar2 != '\0')) &&
      (lVar3 = (longdouble)GetNoiseLevel(this),
      (float)lVar3 < *(float *)(ZombieNoiseLevelMax._28_4_ + 0x2c) * 0.75)))) {
    (**(code **)(*(int *)this + 0x850))
              (this,*(undefined4 *)(ZombieNoiseLevelVocalize._28_4_ + 0x2c));
  }
  if (*(int *)(ZombieNoiseLevelDisplay._28_4_ + 0x30) != 0) {
    lVar3 = (longdouble)GetNoiseLevel(this);
    if ((float)lVar3 != 0.0) {
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      local_30 = *(undefined4 *)(this + 0x2e0);
      local_2c = *(undefined4 *)(this + 0x2e4);
      local_28 = *(float *)(this + 0x2e8) + 40.0;
      fVar1 = *(float *)(ZombieNoiseLevelHoldTime._28_4_ + 0x2c);
      fVar5 = fVar1 - (*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x3310));
      fVar4 = 0.0;
      if (0.0 <= fVar5) {
        fVar4 = fVar5;
      }
      V_snprintf(local_24,0x14,"%.1f (%.1f)",(double)(float)lVar3,
                 (double)(float)(~-(uint)(fVar1 < fVar5) & (uint)fVar4 |
                                (uint)fVar1 & -(uint)(fVar1 < fVar5)));
      NDebugOverlay::Text((Vector *)&local_30,local_24,false,0.0);
    }
  }
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)