L L4D2node

CColorCorrection::Spawn

0x00645630 · 628 bytes · __thiscall

_ZN16CColorCorrection5SpawnEv

Decompiled

undefined (1 param)

/* CColorCorrection::Spawn() */

void __thiscall CColorCorrection::Spawn(CColorCorrection *this)

{
  float fVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  uint uVar4;
  CColorCorrection CVar5;
  undefined1 local_14 [8];
  
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x880;
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
  (**(code **)(*(int *)this + 0x6c))(this);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),0);
  CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)FadeInThink);
  CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)FadeOutThink);
  if (this[0x45c] == (CColorCorrection)0x0) {
    if (this[0x45d] != (CColorCorrection)0x1) {
      if (this[0x6c] == (CColorCorrection)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
      }
      this[0x45d] = (CColorCorrection)0x1;
    }
    if (*(float *)(this + 0x46c) != 1.0) {
      if (this[0x6c] == (CColorCorrection)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x46c) = 0x3f800000;
    }
  }
  else {
    if (this[0x45d] == (CColorCorrection)0x0) {
      fVar1 = *(float *)(this + 0x46c);
    }
    else {
      if (this[0x6c] == (CColorCorrection)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
      }
      fVar1 = *(float *)(this + 0x46c);
      this[0x45d] = (CColorCorrection)0x0;
    }
    if (fVar1 != 0.0) {
      if (this[0x6c] == (CColorCorrection)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x46c) = 0;
    }
  }
  uVar4 = *(uint *)(this + 0x148);
  CVar5 = (CColorCorrection)((byte)uVar4 & 1);
  if (CVar5 != this[0x45e]) {
    if (this[0x6c] == (CColorCorrection)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
        uVar4 = *(uint *)(this + 0x148);
      }
    }
    else {
      this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
    }
    this[0x45e] = CVar5;
  }
  CVar5 = (CColorCorrection)((byte)(uVar4 >> 1) & 1);
  if (CVar5 != this[0x45f]) {
    if (this[0x6c] == (CColorCorrection)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CColorCorrection)((byte)this[0x70] | 1);
    }
    this[0x45f] = CVar5;
  }
  CBaseEntity::Spawn((CBaseEntity *)this);
  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)