L L4D2node

CCSPlayer::FlashlightTurnOff

0x006527f0 · 370 bytes · __thiscall

_ZN9CCSPlayer17FlashlightTurnOffEb

Decompiled

undefined (2 params)

/* CCSPlayer::FlashlightTurnOff(bool) */

void __thiscall CCSPlayer::FlashlightTurnOff(CCSPlayer *this,bool param_1)

{
  uint uVar1;
  CBaseEdict *this_00;
  char cVar2;
  int iVar3;
  float local_50;
  Vector local_48 [12];
  undefined **local_3c [11];
  
  uVar1 = *(uint *)(this + 0xd4);
  if ((uVar1 & 4) != 0) {
    if (uVar1 != (uVar1 & 0xfffffffb)) {
      if (this[0x6c] == (CCSPlayer)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0xd4) = uVar1 & 0xfffffffb;
    }
    cVar2 = (**(code **)(*(int *)this + 300))(this);
    if ((cVar2 != '\0') && (param_1)) {
      (**(code **)(*(int *)this + 0x28c))(local_48,this);
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
      local_3c[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 0065288f to 00652893 has its CatchHandler @ 0065298f */
      CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_3c,local_48);
      local_3c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 006528a2 to 006528f9 has its CatchHandler @ 0065298d */
      iVar3 = CBaseEntity::LookupSoundLevel("Player.FlashlightOff");
      local_50 = 4.0;
      if (0x32 < iVar3) {
        local_50 = 20.0 / (float)(iVar3 + -0x32);
      }
      (**(code **)(*(int *)this + 0x28c))(local_48,this);
      CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_3c,local_48,local_50);
                    /* try { // try from 00652901 to 00652944 has its CatchHandler @ 00652974 */
      CRecipientFilter::RemoveRecipient((CRecipientFilter *)local_3c,(CBasePlayer *)this);
      if (*(int *)(this + 0x30) == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      CBaseEntity::EmitSound
                ((IRecipientFilter *)local_3c,iVar3,"Player.FlashlightOff",(Vector *)0x0,0.0,
                 (float *)0x0);
      local_3c[0] = &PTR__CPASFilter_00bfaf28;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
      return;
    }
  }
  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)