L L4D2node

CCSPlayer::Blind

0x00653900 · 843 bytes · __thiscall

_ZN9CCSPlayer5BlindEfff

Decompiled

undefined (4 params)

/* CCSPlayer::Blind(float, float, float) */

void __thiscall CCSPlayer::Blind(CCSPlayer *this,float param_1,float param_2,float param_3)

{
  CBaseEdict *pCVar1;
  code *pcVar2;
  CCSPlayer CVar3;
  int iVar4;
  int *piVar5;
  undefined4 uVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  color32_s local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  undefined1 local_1d;
  
  iVar4 = gpGlobals;
  local_20 = (color32_s)0xff;
  local_1f = 0xff;
  local_1e = 0xff;
  fVar9 = *(float *)(this + 0x23a0);
  local_1d = (undefined1)(int)param_3;
  fVar8 = *(float *)(this + 0x23a4);
  fVar7 = param_2 * 0.5 + *(float *)(gpGlobals + 0xc) + param_1;
  if (fVar7 <= fVar9) {
    fVar7 = fVar9;
  }
  *(float *)(this + 0x23a0) = fVar7;
  *(undefined4 *)(this + 0x23a4) = *(undefined4 *)(iVar4 + 0xc);
  iVar4 = (**(code **)(*(int *)this + 0x648))(this);
  if ((iVar4 != 0) && (iVar4 = (**(code **)(*(int *)this + 0x648))(this), iVar4 != 4)) {
    if (*(int *)(mp_fadetoblack._28_4_ + 0x30) != 0) {
      return;
    }
    fVar9 = 0.5;
    if (param_2 <= 0.5) {
      fVar9 = param_2;
    }
    local_1d = 0x96;
    fVar8 = fVar9 * 0.5;
    if (param_1 <= fVar9 * 0.5) {
      fVar8 = param_1;
    }
    UTIL_ScreenFade((CBaseEntity *)this,&local_20,fVar9,fVar8,1);
    return;
  }
  fVar7 = param_2 * 0.71428573;
  if (*(float *)(gpGlobals + 0xc) <= fVar9) {
    fVar9 = (fVar8 - *(float *)(gpGlobals + 0xc)) + *(float *)(this + 0x2888);
    if (fVar9 <= fVar7) {
      fVar9 = fVar7;
    }
    if (*(float *)(this + 0x2888) == fVar9) {
      CVar3 = this[0x6c];
    }
    else {
      if (this[0x6c] == (CCSPlayer)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        CVar3 = (CCSPlayer)0x0;
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
          CVar3 = this[0x6c];
        }
      }
      else {
        this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
        CVar3 = (CCSPlayer)0x1;
      }
      *(float *)(this + 0x2888) = fVar9;
    }
    fVar9 = *(float *)(this + 0x288c);
    if (param_3 <= fVar9) {
      param_3 = fVar9;
    }
    if (fVar9 != param_3) {
      if (CVar3 == (CCSPlayer)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
          CVar3 = this[0x6c];
        }
      }
      else {
        this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x288c) = param_3;
    }
  }
  else {
    if (fVar7 == *(float *)(this + 0x2888)) {
      CVar3 = this[0x6c];
    }
    else {
      if (this[0x6c] == (CCSPlayer)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        CVar3 = (CCSPlayer)0x0;
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
          CVar3 = this[0x6c];
        }
      }
      else {
        this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
        CVar3 = (CCSPlayer)0x1;
      }
      *(float *)(this + 0x2888) = fVar7;
    }
    if (param_3 != *(float *)(this + 0x288c)) {
      if (CVar3 == (CCSPlayer)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
          CVar3 = this[0x6c];
        }
      }
      else {
        this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x288c) = param_3;
    }
  }
  if (CVar3 == (CCSPlayer)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
      iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar4 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
  }
  piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"player_blind",0,0);
  if (piVar5 != (int *)0x0) {
    pcVar2 = *(code **)(*piVar5 + 0x30);
    uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
    (*pcVar2)(piVar5,"userid",uVar6);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,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)