L L4D2node

CColorCorrection::FadeInThink

0x006454d0 · 337 bytes · __thiscall

_ZN16CColorCorrection11FadeInThinkEv

Decompiled

undefined (1 param)

/* CColorCorrection::FadeInThink() */

void __thiscall CColorCorrection::FadeInThink(CColorCorrection *this)

{
  float fVar1;
  float fVar2;
  CBaseEdict *this_00;
  int iVar3;
  float fVar4;
  float fVar5;
  
  iVar3 = gpGlobals;
  fVar5 = *(float *)(this + 0x440);
  if (0.0 < fVar5) {
    fVar1 = *(float *)(this + 0x458);
    if ((((*(float *)(this + 0x46c) < fVar1) && (this[0x45d] != (CColorCorrection)0x0)) &&
        (fVar1 != 0.0)) && (fVar2 = *(float *)(this + 0x448), fVar2 < fVar1)) {
      if (0.0 < fVar2) {
        fVar4 = fVar2 / fVar1;
        if (fVar4 <= 0.0) {
          fVar4 = 0.0;
        }
        if (0.99 <= fVar4) {
          fVar4 = 0.99;
        }
        fVar5 = (1.0 - fVar4) * fVar5;
      }
      fVar5 = (*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x450)) / fVar5;
      if (fVar5 <= 0.0) {
        fVar5 = 0.0;
      }
      fVar4 = 0.0;
      if (0.0 <= fVar2) {
        fVar4 = fVar2;
      }
      if (1.0 <= fVar5) {
        fVar5 = 1.0;
      }
      if (1.0 <= fVar4) {
        fVar4 = 1.0;
      }
      *(float *)(this + 0x448) = fVar4;
      fVar4 = fVar5 * (fVar1 - fVar4) + fVar4;
      if (*(float *)(this + 0x46c) != fVar4) {
        if (this[0x6c] == (CColorCorrection)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;
            iVar3 = gpGlobals;
          }
        }
        else {
          this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x46c) = fVar4;
      }
      CBaseEntity::SetNextThink
                ((CBaseEntity *)this,*(float *)(iVar3 + 0x1c) + *(float *)(iVar3 + 0xc),
                 "ColorCorrectionFadeInThink");
      return;
    }
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,"ColorCorrectionFadeInThink");
  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)