L L4D2node

CEnvLaser::Spawn

0x00685db0 · 958 bytes · __thiscall

_ZN9CEnvLaser5SpawnEv

Decompiled

undefined (1 param)

/* CEnvLaser::Spawn() */

void __thiscall CEnvLaser::Spawn(CEnvLaser *this)

{
  CSprite CVar1;
  CEnvLaser CVar2;
  CSprite CVar3;
  CSprite CVar4;
  CSprite CVar5;
  uint uVar6;
  CSprite *this_00;
  CBaseEdict *pCVar7;
  char *pcVar8;
  int *piVar9;
  int iVar10;
  undefined *puVar11;
  float fVar12;
  Vector *pVVar13;
  Vector *pVVar14;
  undefined4 uVar15;
  undefined4 uVar16;
  undefined4 uVar17;
  undefined1 local_2c [12];
  int local_20 [4];
  
  (**(code **)(*(int *)this + 0x20))(local_20,this);
  if (local_20[0] == 0) {
    CBaseEntity::ThinkSet((_func_void *)local_2c,(float)this,(char *)CBaseEntity::SUB_Remove);
    return;
  }
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),0);
  uVar17 = 0;
  uVar16 = 0;
  uVar15 = 0;
  CBaseEntity::ThinkSet((_func_void *)local_2c,(float)this,(char *)StrikeThink);
  fVar12 = *(float *)(this + 0x4b0);
  if (102.3 <= fVar12) {
    fVar12 = 102.3;
  }
  if (fVar12 != *(float *)(this + 0x4b4)) {
    if (this[0x6c] == (CEnvLaser)0x0) {
      pCVar7 = *(CBaseEdict **)(this + 0x30);
      if (pCVar7 != (CBaseEdict *)0x0) {
        *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
        iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
        *(undefined2 *)(iVar10 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CEnvLaser)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x4b4) = fVar12;
  }
  pVVar13 = (Vector *)(this + 0x39c);
  pVVar14 = pVVar13;
  CBeam::PointsInit((CBeam *)this,pVVar13,pVVar13);
  (**(code **)(*(int *)this + 0x6c))(this,pVVar13,pVVar14,uVar15,uVar16,uVar17);
  if ((*(int *)(this + 0x4e8) == 0) && (*(char **)(this + 0x4ec) != (char *)0x0)) {
    pcVar8 = *(char **)(this + 0x4ec);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      pcVar8 = "";
      if (*(char **)(this + 0x4ec) != (char *)0x0) {
        pcVar8 = *(char **)(this + 0x4ec);
      }
    }
    piVar9 = (int *)CSprite::SpriteCreate(pcVar8,(Vector *)(this + 0x2e0),true);
    *(int **)(this + 0x4e8) = piVar9;
    if (piVar9 != (int *)0x0) {
      uVar15 = 0;
      uVar6 = *(uint *)(this + 0x188);
      if (((uVar6 != 0xffffffff) &&
          (puVar11 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar11 + 8) == uVar6 >> 0xc)) {
        uVar15 = *(undefined4 *)(puVar11 + 4);
      }
      (**(code **)(*piVar9 + 0x98))(piVar9,uVar15,0xffffffff);
      CVar1 = *(CSprite *)(this + 0x120);
      this_00 = *(CSprite **)(this + 0x4e8);
      CVar2 = this[0x127];
      CVar3 = *(CSprite *)(this + 0x125);
      CVar4 = *(CSprite *)(this + 0x126);
      CVar5 = *(CSprite *)(this + 0x124);
      if (this_00[0x121] != (CSprite)0x3) {
        if (this_00[0x6c] == (CSprite)0x0) {
          pCVar7 = *(CBaseEdict **)(this_00 + 0x30);
          if (pCVar7 != (CBaseEdict *)0x0) {
            *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this_00[0x70] = (CSprite)((byte)this_00[0x70] | 1);
        }
        this_00[0x121] = (CSprite)0x3;
      }
      if (CVar5 != this_00[0x124]) {
        if (this_00[0x6c] == (CSprite)0x0) {
          pCVar7 = *(CBaseEdict **)(this_00 + 0x30);
          if (pCVar7 != (CBaseEdict *)0x0) {
            *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this_00[0x70] = (CSprite)((byte)this_00[0x70] | 1);
        }
        this_00[0x124] = CVar5;
      }
      if (CVar3 != this_00[0x125]) {
        if (this_00[0x6c] == (CSprite)0x0) {
          pCVar7 = *(CBaseEdict **)(this_00 + 0x30);
          if (pCVar7 != (CBaseEdict *)0x0) {
            *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this_00[0x70] = (CSprite)((byte)this_00[0x70] | 1);
        }
        this_00[0x125] = CVar3;
      }
      if (CVar4 != this_00[0x126]) {
        if (this_00[0x6c] == (CSprite)0x0) {
          pCVar7 = *(CBaseEdict **)(this_00 + 0x30);
          if (pCVar7 != (CBaseEdict *)0x0) {
            *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this_00[0x70] = (CSprite)((byte)this_00[0x70] | 1);
        }
        this_00[0x126] = CVar4;
      }
      CSprite::SetBrightness(this_00,(uint)(byte)CVar2,0.0);
      if (CVar1 != this_00[0x120]) {
        if (this_00[0x6c] == (CSprite)0x0) {
          pCVar7 = *(CBaseEdict **)(this_00 + 0x30);
          if (pCVar7 != (CBaseEdict *)0x0) {
            *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          this_00[0x70] = (CSprite)((byte)this_00[0x70] | 1);
        }
        this_00[0x120] = CVar1;
      }
    }
  }
  else {
    *(undefined4 *)(this + 0x4e8) = 0;
  }
  if ((*(int *)(this + 0x154) != 0) && (((byte)this[0x148] & 1) == 0)) {
    TurnOff(this);
    return;
  }
  TurnOn(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)