L L4D2node

CEnvBeam::Strike

0x006826d0 · 2199 bytes · __thiscall

_ZN8CEnvBeam6StrikeEv

Decompiled

undefined (1 param)

/* CEnvBeam::Strike() */

void __thiscall CEnvBeam::Strike(CEnvBeam *this)

{
  float fVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  CBaseEntity CVar5;
  CEnvBeam CVar6;
  CEnvBeam CVar7;
  CEnvBeam CVar8;
  CEnvBeam CVar9;
  code *pcVar10;
  undefined4 uVar11;
  undefined4 uVar12;
  undefined4 uVar13;
  char cVar14;
  char cVar15;
  CBaseEntity *this_00;
  char *pcVar16;
  CBaseEntity *this_01;
  int iVar17;
  int iVar18;
  CBaseEntity *pCVar19;
  CBaseEntity *local_138;
  int local_104;
  int local_100;
  CTraceFilterSimple local_fc [16];
  undefined **local_ec [8];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  Vector local_64 [84];
  
  CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_ec);
  local_ec[0] = &PTR__CBroadcastRecipientFilter_00c09928;
                    /* try { // try from 00682700 to 00682704 has its CatchHandler @ 00682fcb */
  CRecipientFilter::AddAllPlayers((CRecipientFilter *)local_ec);
  pcVar16 = "";
  if (*(char **)(this + 0x4ec) != (char *)0x0) {
    pcVar16 = *(char **)(this + 0x4ec);
  }
                    /* try { // try from 0068271c to 00682f77 has its CatchHandler @ 00682fa9 */
  this_00 = (CBaseEntity *)CBeam::RandomTargetname((CBeam *)this,pcVar16);
  pcVar16 = "";
  if (*(char **)(this + 0x4f0) != (char *)0x0) {
    pcVar16 = *(char **)(this + 0x4f0);
  }
  this_01 = (CBaseEntity *)CBeam::RandomTargetname((CBeam *)this,pcVar16);
  if ((this_01 == (CBaseEntity *)0x0) || (this_00 == (CBaseEntity *)0x0)) goto LAB_00682d1a;
  iVar17 = *(int *)(this + 0x500);
  if ((float)iVar17 <= 100.0) {
    iVar18 = 0;
    if (-1 < iVar17) {
      iVar18 = iVar17;
    }
    iVar17 = (int)(float)iVar18;
  }
  else {
    iVar17 = 100;
  }
  *(int *)(this + 0x500) = iVar17;
  cVar14 = IsStaticPointEntity(this_00);
  cVar15 = IsStaticPointEntity(this_01);
  if ((cVar15 == '\0') && (cVar14 == '\0')) {
    if ((*(uint *)(this + 0x148) & 8) == 0) {
      if (*(int *)(this_01 + 0x30) == 0) {
        iVar17 = 0;
      }
      else {
        iVar17 = *(int *)(this_01 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      iVar18 = 0;
      if (*(int *)(this_00 + 0x30) != 0) {
        iVar18 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      (**(code **)(*(int *)te + 0x14))
                (te,local_ec,0,iVar18,iVar17,*(undefined4 *)(this + 0x4e8),0,
                 *(undefined4 *)(this + 0x50c),(int)*(float *)(this + 0x440),
                 *(undefined4 *)(this + 0x4f4),*(undefined4 *)(this + 0x4f8),
                 *(undefined4 *)(this + 0x4f8),0,*(undefined4 *)(this + 0x4fc),this[0x124],
                 this[0x125],this[0x126],this[0x127],*(undefined4 *)(this + 0x500));
      goto LAB_00682b13;
    }
    if (*(int *)(this_01 + 0x30) == 0) {
      local_100 = 0;
    }
    else {
      local_100 = *(int *)(this_01 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    if (*(int *)(this_00 + 0x30) == 0) {
      iVar17 = 0;
    }
    else {
      iVar17 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    (**(code **)(*(int *)te + 0x24))
              (te,local_ec,0,iVar17,local_100,*(undefined4 *)(this + 0x4e8),0,
               *(undefined4 *)(this + 0x50c),(int)*(float *)(this + 0x440),
               *(undefined4 *)(this + 0x4f4),*(undefined4 *)(this + 0x4f8),0,
               *(undefined4 *)(this + 0x4fc),this[0x124],this[0x125],this[0x126],this[0x127],
               *(undefined4 *)(this + 0x500),0);
    CVar5 = this_01[0x14d];
  }
  else {
    if (((byte)this[0x148] & 8) != 0) goto LAB_00682d1a;
    fVar1 = *(float *)(this + 0x440);
    uVar2 = *(undefined4 *)(this + 0x4fc);
    uVar3 = *(undefined4 *)(this + 0x4f4);
    uVar4 = *(undefined4 *)(this + 0x4f8);
    pcVar10 = *(code **)(*(int *)te + 0x10);
    uVar11 = *(undefined4 *)(this + 0x500);
    CVar6 = this[0x127];
    CVar7 = this[0x126];
    CVar8 = this[0x125];
    CVar9 = this[0x124];
    uVar12 = *(undefined4 *)(this + 0x50c);
    uVar13 = *(undefined4 *)(this + 0x4e8);
    if (cVar15 == '\0') {
      if (*(int *)(this_01 + 0x30) == 0) {
        local_138 = (CBaseEntity *)0x0;
        local_104 = 0;
      }
      else {
        local_138 = (CBaseEntity *)0x0;
        local_104 = *(int *)(this_01 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
    }
    else {
      if (((byte)this_01[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_01);
      }
      local_104 = 0;
      local_138 = this_01 + 0x2e0;
    }
    if (cVar14 == '\0') {
      if (*(int *)(this_00 + 0x30) == 0) {
        pCVar19 = (CBaseEntity *)0x0;
        iVar17 = 0;
      }
      else {
        pCVar19 = (CBaseEntity *)0x0;
        iVar17 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
    }
    else {
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      pCVar19 = this_00 + 0x2e0;
      iVar17 = 0;
    }
    (*pcVar10)(te,local_ec,0,iVar17,pCVar19,local_104,local_138,uVar13,0,uVar12,(int)fVar1,uVar3,
               uVar4,uVar4,0,uVar2,CVar9,CVar8,CVar7,CVar6,uVar11);
LAB_00682b13:
    CVar5 = this_01[0x14d];
  }
  if (((byte)CVar5 & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_01);
  }
  if (((byte)this_00[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_00);
  }
  CBeam::DoSparks((CBeam *)this,(Vector *)(this_00 + 0x2e0),(Vector *)(this_01 + 0x2e0));
  if (0.0 < *(float *)(this + 0x44c)) {
    if (((byte)this_01[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_01);
    }
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    local_cc = *(float *)(this_00 + 0x2e0);
    local_94 = 0;
    local_88 = 1;
    local_c8 = *(float *)(this_00 + 0x2e4);
    local_bc = *(float *)(this_01 + 0x2e0) - local_cc;
    local_98 = 0;
    local_c4 = *(float *)(this_00 + 0x2e8);
    local_9c = 0;
    local_b8 = *(float *)(this_01 + 0x2e4) - local_c8;
    local_b4 = *(float *)(this_01 + 0x2e8) - local_c4;
    local_8c = 0;
    local_a4 = 0;
    local_a8 = 0;
    local_ac = 0;
    local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
    CTraceFilterSimple::CTraceFilterSimple
              (local_fc,(IHandleEntity *)0x0,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
    (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_fc,local_70);
    if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
      DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
    }
    *(float *)(this + 0x448) = *(float *)(gpGlobals + 0xc) - 1.0;
    CBeam::BeamDamage((CBeam *)this,(CGameTrace *)local_70);
  }
LAB_00682d1a:
  local_ec[0] = &PTR__CBroadcastRecipientFilter_00c09928;
  CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_ec);
  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)