L L4D2node

CEnvBeam::TurnOn

0x00682440 · 375 bytes · __thiscall

_ZN8CEnvBeam6TurnOnEv

Decompiled

undefined (1 param)

/* CEnvBeam::TurnOn() */

void __thiscall CEnvBeam::TurnOn(CEnvBeam *this)

{
  CBaseEdict *this_00;
  int iVar1;
  uint *puVar2;
  Vector *pVVar3;
  Vector *pVVar4;
  uint uVar5;
  undefined1 local_14 [8];
  
  *(undefined4 *)(this + 0x4e4) = 1;
  if ((*(float *)(this + 0x4f4) == 0.0) && (((byte)this[0x148] & 8) == 0)) {
    uVar5 = *(uint *)(this + 0xd4) & 0xffffffdf;
    if (*(uint *)(this + 0xd4) == uVar5) {
      puVar2 = *(uint **)(this + 0x30);
    }
    else {
      if (this[0x6c] == (CEnvBeam)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        puVar2 = (uint *)0x0;
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar1 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar1 + 2) = 0;
          puVar2 = *(uint **)(this + 0x30);
        }
      }
      else {
        this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
        puVar2 = *(uint **)(this + 0x30);
      }
      *(uint *)(this + 0xd4) = uVar5;
    }
    if (puVar2 != (uint *)0x0) {
      *puVar2 = *puVar2 | 0x80;
    }
    CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
    pVVar3 = (Vector *)CBeam::GetAbsEndPos((CBeam *)this);
    pVVar4 = (Vector *)CBeam::GetAbsStartPos((CBeam *)this);
    CBeam::DoSparks((CBeam *)this,pVVar4,pVVar3);
    CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)UpdateThink);
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
    *(undefined4 *)(this + 0x448) = *(undefined4 *)(gpGlobals + 0xc);
    return;
  }
  CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)StrikeThink);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  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)