L L4D2node

CEnvBeam::Spawn

0x00681be0 · 871 bytes · __thiscall

_ZN8CEnvBeam5SpawnEv

Decompiled

undefined (1 param)

/* CEnvBeam::Spawn() */

void __thiscall CEnvBeam::Spawn(CEnvBeam *this)

{
  CBaseEdict *pCVar1;
  int iVar2;
  float fVar3;
  float fVar4;
  undefined1 local_14 [12];
  
  if (*(int *)(this + 0x508) == 0) {
    CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)CBaseEntity::SUB_Remove);
    return;
  }
  CBeam::Spawn((CBeam *)this);
  fVar3 = *(float *)(this + 0x4fc);
  if (64.0 <= fVar3) {
    fVar3 = 64.0;
  }
  *(float *)(this + 0x4fc) = fVar3;
  if (((byte)this[0x149] & 2) == 0) {
    fVar3 = *(float *)(this + 0x4f8);
    if (102.3 <= fVar3) {
      fVar3 = 102.3;
    }
    fVar4 = *(float *)(this + 0x4b0);
    if (fVar3 != *(float *)(this + 0x4b0)) {
      if (this[0x6c] == (CEnvBeam)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4b0) = fVar3;
      fVar4 = fVar3;
    }
    fVar3 = 102.3;
    if (fVar4 <= 102.3) {
      fVar3 = fVar4;
    }
    if (fVar3 != *(float *)(this + 0x4b4)) {
      if (this[0x6c] == (CEnvBeam)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4b4) = fVar3;
    }
  }
  else {
    fVar3 = *(float *)(this + 0x4f8);
    if (102.3 <= fVar3) {
      fVar3 = 102.3;
    }
    if (fVar3 != *(float *)(this + 0x4b0)) {
      if (this[0x6c] == (CEnvBeam)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4b0) = fVar3;
    }
    if (*(float *)(this + 0x4b4) != 0.0) {
      if (this[0x6c] == (CEnvBeam)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEnvBeam)((byte)this[0x70] | 1);
      }
      fVar3 = *(float *)(this + 0x4f4);
      *(undefined4 *)(this + 0x4b4) = 0;
      goto joined_r0x00681d75;
    }
  }
  fVar3 = *(float *)(this + 0x4f4);
joined_r0x00681d75:
  if ((fVar3 == 0.0) && (((byte)this[0x148] & 8) == 0)) {
    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);
    if (*(int *)(this + 0x154) != 0) {
      if (((byte)this[0x148] & 1) == 0) {
        CBaseEntity::AddEffects((CBaseEntity *)this,0x20);
        *(undefined4 *)(this + 0x4e4) = 0;
        CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
      }
      else {
        *(undefined4 *)(this + 0x4e4) = 1;
      }
    }
  }
  else {
    *(undefined4 *)(this + 0x4e4) = 0;
    if ((*(int *)(this + 0x154) == 0) || (((byte)this[0x148] & 1) != 0)) {
      CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)StrikeThink);
      CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
      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)