L L4D2node

CFuelBarrelProp::Detonate

0x00904890 · 2959 bytes · __thiscall

_ZN15CFuelBarrelProp8DetonateEv

Decompiled

undefined (1 param)

/* CFuelBarrelProp::Detonate() */

void __thiscall CFuelBarrelProp::Detonate(CFuelBarrelProp *this)

{
  uint uVar1;
  float fVar2;
  CBaseEdict *this_00;
  int *piVar3;
  code *pcVar4;
  char cVar5;
  float *pfVar6;
  char *pcVar7;
  undefined1 *puVar8;
  int iVar9;
  int iVar10;
  CInferno *this_01;
  int *piVar11;
  undefined4 uVar12;
  CBaseEntity *pCVar13;
  undefined *puVar14;
  undefined1 *puVar15;
  longdouble lVar16;
  longdouble lVar17;
  longdouble lVar18;
  QAngle *local_124;
  Vector *local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  float local_110;
  float local_10c;
  float local_108;
  Vector local_104 [12];
  float local_f8;
  float local_f4;
  float local_f0;
  Vector local_ec [12];
  float local_e0;
  float local_dc;
  float local_d8;
  Vector local_d0 [12];
  Vector local_c4 [12];
  float local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  float local_a4;
  char local_9a;
  char local_99;
  float local_7c;
  float local_78;
  float local_74;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_3c;
  undefined1 local_38;
  undefined1 local_37;
  
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_11c = *(undefined4 *)(this + 0x37c);
  local_118 = *(undefined4 *)(this + 0x380);
  local_114 = *(undefined4 *)(this + 900);
  pfVar6 = (float *)(**(code **)(*(int *)this + 0x288))(this);
  local_110 = *pfVar6;
  local_10c = pfVar6[1];
  local_108 = pfVar6[2];
  local_6c = 0;
  local_68 = 0;
  local_64 = 0xc3000000;
  local_37 = 1;
  local_44 = 0;
  local_48 = 0;
  local_4c = 0;
  local_3c = 0;
  local_38 = 1;
  local_54 = 0;
  local_58 = 0;
  local_5c = 0;
  local_7c = local_110;
  local_78 = local_10c;
  local_74 = local_108;
  CTraceFilterSimple::CTraceFilterSimple
            ((CTraceFilterSimple *)&local_e0,(IHandleEntity *)this,0,
             (_func_bool_IHandleEntity_ptr_int *)0x0);
  (**(code **)(*enginetrace + 0x14))(enginetrace,&local_7c,0x600400b,&local_e0,local_d0);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_d0,local_c4,0xff,0,0,true,-1.0);
  }
  if (*(int *)(fuel_barrel_debug._28_4_ + 0x30) != 0) {
    uVar1 = *(uint *)(this + 0x16ac);
    if ((((uVar1 == 0xffffffff) ||
         (puVar14 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar14 == (undefined *)0xfffffffc)) ||
        (*(uint *)(puVar14 + 8) != uVar1 >> 0xc)) || (iVar9 = *(int *)(puVar14 + 4), iVar9 == 0)) {
      puVar15 = &DAT_00d539c2;
      pcVar7 = "UNKNOWN";
    }
    else {
      puVar15 = *(undefined1 **)(iVar9 + 0x154);
      if (puVar15 == (undefined1 *)0x0) {
        puVar15 = &DAT_00d539c2;
      }
      pcVar7 = "";
      if (*(char **)(iVar9 + 0x7c) != (char *)0x0) {
        pcVar7 = *(char **)(iVar9 + 0x7c);
      }
    }
    Msg("prop_fuel_barrel exploding with attacker %s %s \n",pcVar7,puVar15);
    NDebugOverlay::Cross3D((Vector *)&local_110,10.0,0,0,0xff,true,5.0);
  }
  local_120 = (Vector *)&local_110;
  uVar1 = *(uint *)(this + 0x1464);
  if ((((uVar1 != 0xffffffff) &&
       (puVar14 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar14 != (undefined *)0xfffffffc)) &&
      ((*(uint *)(puVar14 + 8) == uVar1 >> 0xc &&
       ((piVar3 = *(int **)(puVar14 + 4), piVar3 != (int *)0x0 &&
        (cVar5 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar5 != '\0')))))) &&
     (piVar11 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                 (gameeventmanager,"hegrenade_detonate",0,0), piVar11 != (int *)0x0)
     ) {
    pcVar4 = *(code **)(*piVar11 + 0x30);
    uVar12 = (**(code **)(*engine + 0x40))(engine,piVar3[0xc]);
    (*pcVar4)(piVar11,"userid",uVar12);
    pcVar4 = *(code **)(*piVar11 + 0x38);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    (*pcVar4)(piVar11,&DAT_00c147b6,*(undefined4 *)(this + 0x2e0));
    pcVar4 = *(code **)(*piVar11 + 0x38);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    (*pcVar4)(piVar11,&DAT_00ca1f7c,*(undefined4 *)(this + 0x2e4));
    pcVar4 = *(code **)(*piVar11 + 0x38);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    (*pcVar4)(piVar11,&DAT_00ca1f82,*(undefined4 *)(this + 0x2e8));
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar11,0);
  }
  UTIL_ScreenShake(local_120,*(undefined4 *)(fuel_barrel_screen_shake_amplitude._28_4_ + 0x2c),
                   *(undefined4 *)(fuel_barrel_screen_shake_frequency._28_4_ + 0x2c),
                   *(undefined4 *)(fuel_barrel_screen_shake_duration._28_4_ + 0x2c),
                   *(undefined4 *)(fuel_barrel_screen_shake_radius._28_4_ + 0x2c),0,0,0);
  if (*(int *)(this + 0x169c) != 0) {
    DispatchParticleEffect
              (*(int *)(this + 0x169c),local_110,local_10c,local_108,vec3_angle,DAT_01053d40,
               DAT_01053d44,0,0,0xffffffff);
  }
  if (*(char **)(this + 0x16a4) != (char *)0x0) {
    CBaseEntity::EmitSound((CBaseEntity *)this,*(char **)(this + 0x16a4),0.0,(float *)0x0);
  }
  pCVar13 = (CBaseEntity *)0x0;
  fVar2 = *(float *)(fuel_barrel_damage_radius._28_4_ + 0x2c);
  local_e0 = vec3_origin;
  local_dc = DAT_01053d4c;
  local_d8 = DAT_01053d50;
  uVar1 = *(uint *)(this + 0x16ac);
  if (((uVar1 != 0xffffffff) &&
      (puVar14 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar14 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar14 + 8) == uVar1 >> 0xc)) {
    pCVar13 = *(CBaseEntity **)(puVar14 + 4);
  }
  CTakeDamageInfo::CTakeDamageInfo
            ((CTakeDamageInfo *)&local_7c,(CBaseEntity *)this,pCVar13,(Vector *)&local_e0,local_120,
             *(float *)(fuel_barrel_damage_amount._28_4_ + 0x2c),0x40,3,(Vector *)0x0);
  RadiusDamage((CTakeDamageInfo *)&local_7c,local_120,fVar2,0,(CBaseEntity *)this);
  if (*(int *)(this + 0x1688) != 0) {
    pCVar13 = (CBaseEntity *)
              CBaseEntity::CreateNoSpawn
                        ("prop_physics",local_120,(QAngle *)&local_11c,(CBaseEntity *)this);
    if (pCVar13 != (CBaseEntity *)0x0) {
      puVar15 = *(undefined1 **)(this + 0x1688);
      *(undefined1 **)(pCVar13 + 0x260) = puVar15;
      CBaseEntity::DispatchUpdateTransmitState(pCVar13);
      puVar8 = &DAT_00d539c2;
      if (puVar15 != (undefined1 *)0x0) {
        puVar8 = puVar15;
      }
      iVar9 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar8);
      if (iVar9 != *(int *)(pCVar13 + 0xf4)) {
        if (pCVar13[0x6c] == (CBaseEntity)0x0) {
          this_00 = *(CBaseEdict **)(pCVar13 + 0x30);
          if (this_00 != (CBaseEdict *)0x0) {
            *(uint *)this_00 = *(uint *)this_00 | 0x101;
            iVar10 = CBaseEdict::GetChangeAccessor(this_00);
            *(undefined2 *)(iVar10 + 2) = 0;
          }
        }
        else {
          pCVar13[0x70] = (CBaseEntity)((byte)pCVar13[0x70] | 1);
        }
        *(int *)(pCVar13 + 0xf4) = iVar9;
      }
      DispatchSpawn(pCVar13,true);
      CBaseEntity::SetLocalVelocity(pCVar13,(Vector *)(this + 0x2ec));
      AngleVectors((QAngle *)&local_11c,local_104,local_ec,(Vector *)&local_f8);
      lVar16 = (longdouble)RandomFloat(0x442f0000,0x447a0000);
      local_dc = (float)lVar16;
      local_e0 = -local_f8 * local_dc;
      local_d8 = -local_f0 * 1.5 * local_dc;
      local_dc = -local_f4 * local_dc;
      iVar9 = rand();
      local_7c = (float)iVar9 * 0.0012207404 - 20.0;
      iVar9 = rand();
      local_78 = (float)iVar9 * 0.0012207404 - 20.0;
      iVar9 = rand();
      local_74 = (float)iVar9 * 0.0012207404 - 20.0;
      CBaseEntity::ApplyLocalAngularVelocityImpulse(pCVar13,(Vector *)&local_7c);
      CBaseEntity::ApplyAbsVelocityImpulse(pCVar13,(Vector *)&local_e0);
      if (*(int *)(fuel_barrel_debug._28_4_ + 0x30) != 0) {
        if (((byte)this[0x14d] & 8) == 0) {
          local_7c = local_e0 + *(float *)(this + 0x2e0);
          local_78 = local_dc + *(float *)(this + 0x2e4);
          local_74 = local_d8 + *(float *)(this + 0x2e8);
        }
        else {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
          local_7c = local_e0 + *(float *)(this + 0x2e0);
          local_78 = local_dc + *(float *)(this + 0x2e4);
          local_74 = local_d8 + *(float *)(this + 0x2e8);
          if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
            CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
          }
        }
        NDebugOverlay::Line((Vector *)(this + 0x2e0),(Vector *)&local_7c,0,0,0xff,true,5.0);
      }
    }
  }
  local_124 = (QAngle *)&local_11c;
  iVar9 = 0;
  do {
    if ((*(int *)(this + iVar9 * 4 + 0x168c) != 0) &&
       (pCVar13 = (CBaseEntity *)
                  CFuelBarrelPiece::Create
                            (local_120,local_124,*(undefined4 *)(this + iVar9 * 4 + 0x168c),
                             *(undefined4 *)(this + 0x16a0)), pCVar13 != (CBaseEntity *)0x0)) {
      CBaseEntity::SetLocalVelocity(pCVar13,(Vector *)(this + 0x2ec));
      iVar10 = rand();
      local_7c = (float)iVar10 * 0.0012207404 - 20.0;
      iVar10 = rand();
      local_78 = (float)iVar10 * 0.0012207404 - 20.0;
      iVar10 = rand();
      local_74 = (float)iVar10 * 0.0012207404 - 20.0;
      CBaseEntity::ApplyLocalAngularVelocityImpulse(pCVar13,(Vector *)&local_7c);
      lVar16 = (longdouble)RandomFloat(0x442f0000,0x447a0000);
      lVar17 = (longdouble)RandomFloat(0xc3480000,0x43480000);
      lVar18 = (longdouble)RandomFloat(0xc3480000,0x43480000);
      local_7c = (float)lVar18;
      local_78 = (float)lVar17;
      local_74 = (float)lVar16;
      CBaseEntity::ApplyAbsVelocityImpulse(pCVar13,(Vector *)&local_7c);
    }
    iVar9 = iVar9 + 1;
  } while (iVar9 != 4);
  uVar1 = *(uint *)(this + 0x16ac);
  pCVar13 = (CBaseEntity *)0x0;
  if (((uVar1 != 0xffffffff) &&
      (puVar14 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar14 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar14 + 8) == uVar1 >> 0xc)) {
    pCVar13 = *(CBaseEntity **)(puVar14 + 4);
  }
  this_01 = (CInferno *)CBaseEntity::Create("inferno",local_120,local_124,pCVar13);
  if (this_01 != (CInferno *)0x0) {
    if (((local_a4 < 1.0) || (local_9a != '\0')) || (local_99 != '\0')) {
      local_e0 = local_b8;
      local_dc = (float)local_b4;
      local_d8 = (float)local_b0;
    }
    else {
      local_e0 = 0.0;
      local_dc = 0.0;
      local_d8 = 1.0;
    }
    local_7c = vec3_origin;
    local_74 = DAT_01053d50;
    local_78 = DAT_01053d4c;
    *(undefined4 *)(this_01 + 0xba4) = *(undefined4 *)(fuel_barrel_flame_instances._28_4_ + 0x30);
    *(undefined4 *)(this_01 + 0xbb4) = 3;
    CInferno::StartBurning(this_01,local_120,(Vector *)&local_e0,(Vector *)&local_7c,0);
  }
  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)