L L4D2node

CCharge::DoImpactProbe

0x004d4240 · 1861 bytes · __thiscall

_ZN7CCharge13DoImpactProbeEv

Decompiled

undefined (1 param)

/* CCharge::DoImpactProbe() */

void __thiscall CCharge::DoImpactProbe(CCharge *this)

{
  undefined4 uVar1;
  undefined4 uVar2;
  CBaseEntity *this_00;
  float fVar3;
  int *piVar4;
  char cVar5;
  undefined4 *puVar6;
  uint uVar7;
  int iVar8;
  uint uVar9;
  CTerrorPlayer *pCVar10;
  bool bVar11;
  undefined *puVar12;
  longdouble lVar13;
  float fVar14;
  float local_ec;
  float local_e8;
  float local_e4;
  CTraceFilterSimple local_e0 [16];
  Vector local_d0 [12];
  Vector local_c4 [12];
  float local_b8;
  float local_b4;
  float local_b0;
  float local_a4;
  CBaseEntity *local_84;
  undefined4 local_7c;
  undefined4 local_78;
  float local_74;
  undefined4 local_70;
  float local_6c;
  float local_68;
  float local_64;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  float local_40;
  undefined4 local_3c;
  undefined1 local_38;
  undefined1 local_37;
  undefined4 local_34;
  
  uVar9 = *(uint *)(this + 0x44c);
  if (uVar9 == 0xffffffff) {
    return;
  }
  puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10;
  if (puVar12 == (undefined *)0xfffffffc) {
    return;
  }
  if (*(uint *)(puVar12 + 8) != uVar9 >> 0xc) {
    return;
  }
  this_00 = *(CBaseEntity **)(puVar12 + 4);
  if (this_00 == (CBaseEntity *)0x0) {
    return;
  }
  if (((byte)this_00[0x150] & 1) == 0) {
    return;
  }
  puVar6 = (undefined4 *)(**(code **)(*(int *)this_00 + 0x288))(this_00);
  uVar1 = *puVar6;
  uVar2 = puVar6[1];
  fVar3 = (float)puVar6[2];
  (**(code **)(*(int *)this_00 + 0x24c))(this_00,&local_ec,0,0);
  fVar14 = *(float *)(z_charger_probe_alone._28_4_ + 0x2c);
  uVar7 = (**(code **)(*(int *)this_00 + 0x7a0))(this_00,0);
  uVar9 = *(uint *)(this_00 + 0x2a48);
  if ((((uVar9 != 0xffffffff) &&
       (puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar12 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar12 + 8) == uVar9 >> 0xc)) &&
     (piVar4 = *(int **)(puVar12 + 4), piVar4 != (int *)0x0)) {
    uVar9 = (**(code **)(*piVar4 + 0x7a0))(piVar4,0);
    uVar7 = uVar7 | uVar9;
    fVar14 = *(float *)(z_charger_probe_attack._28_4_ + 0x2c);
  }
  local_6c = local_ec * fVar14;
  local_38 = 0;
  local_68 = local_e8 * fVar14;
  local_64 = fVar14 * local_e4;
  local_3c = 0;
  local_4c = 0x41700000;
  local_48 = 0x41700000;
  local_44 = 0x41900000;
  local_5c = 0;
  local_58 = 0;
  local_37 = local_68 * local_68 + local_6c * local_6c + local_64 * local_64 != 0.0;
  local_54 = 0xc0c00000;
  local_74 = fVar3 + 6.0;
  local_7c = uVar1;
  local_78 = uVar2;
  CTraceFilterSimple::CTraceFilterSimple
            (local_e0,(IHandleEntity *)0x0,8,(_func_bool_IHandleEntity_ptr_int *)0x0);
  (**(code **)(*enginetrace + 0x14))(enginetrace,&local_7c,uVar7,local_e0,local_d0);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_d0,local_c4,0xff,0xff,0,true,-1.0);
  }
  if (local_84 != (CBaseEntity *)0x0) {
    uVar9 = *(uint *)(this_00 + 0x2a48);
    piVar4 = *(int **)(local_84 + 0x238);
    if (((uVar9 == 0xffffffff) ||
        (puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar12 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar12 + 8) != uVar9 >> 0xc || (*(int *)(puVar12 + 4) == 0)))) {
      if (piVar4 != (int *)0x0) goto LAB_004d44de;
    }
    else if (piVar4 != (int *)0x0) {
      if ((*(char **)(local_84 + 0x7c) == "prop_car_alarm") ||
         (cVar5 = CBaseEntity::ClassMatchesComplex(local_84,"prop_car_alarm"), cVar5 != '\0')) {
        CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c);
        local_40 = 1.0;
        local_34 = 0x80;
        if (((byte)this_00[0x14d] & 0x10) != 0) {
          CBaseEntity::CalcAbsoluteVelocity(this_00);
        }
        local_7c = *(undefined4 *)(this_00 + 0x274);
        local_78 = *(undefined4 *)(this_00 + 0x278);
        local_74 = *(float *)(this_00 + 0x27c);
        puVar6 = (undefined4 *)(**(code **)(*(int *)local_84 + 0x288))(local_84);
        local_70 = *puVar6;
        local_6c = (float)puVar6[1];
        local_68 = (float)puVar6[2];
        uVar9 = *(uint *)(this_00 + 0x2a48);
        if ((((uVar9 == 0xffffffff) ||
             (puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar12 == (undefined *)0xfffffffc))
            || (*(uint *)(puVar12 + 8) != uVar9 >> 0xc)) ||
           (piVar4 = *(int **)(puVar12 + 4), piVar4 == (int *)0x0)) {
          local_48 = 0xffffffff;
        }
        else {
          puVar6 = (undefined4 *)(**(code **)(*piVar4 + 0xc))(piVar4);
          local_48 = *puVar6;
          uVar9 = *(uint *)(this_00 + 0x2a48);
        }
        if (((uVar9 == 0xffffffff) ||
            (puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar12 == (undefined *)0xfffffffc))
           || ((*(uint *)(puVar12 + 8) != uVar9 >> 0xc ||
               (piVar4 = *(int **)(puVar12 + 4), piVar4 == (int *)0x0)))) {
          local_4c = 0xffffffff;
        }
        else {
          puVar6 = (undefined4 *)(**(code **)(*piVar4 + 0xc))(piVar4);
          local_4c = *puVar6;
        }
        goto LAB_004d45a2;
      }
LAB_004d44de:
      lVar13 = (longdouble)(**(code **)(*piVar4 + 0x78))(piVar4);
      if ((float)lVar13 < 250.0) {
        CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c);
        local_34 = 0x80;
        local_40 = (float)(*(int *)(local_84 + 0x100) + 1);
        if (((byte)this_00[0x14d] & 0x10) != 0) {
          CBaseEntity::CalcAbsoluteVelocity(this_00);
        }
        local_7c = *(undefined4 *)(this_00 + 0x274);
        local_78 = *(undefined4 *)(this_00 + 0x278);
        local_74 = *(float *)(this_00 + 0x27c);
        puVar6 = (undefined4 *)(**(code **)(*(int *)local_84 + 0x288))(local_84);
        local_70 = *puVar6;
        local_6c = (float)puVar6[1];
        local_68 = (float)puVar6[2];
        puVar6 = (undefined4 *)(**(code **)(*(int *)this_00 + 0xc))(this_00);
        local_48 = *puVar6;
        puVar6 = (undefined4 *)(**(code **)(*(int *)this_00 + 0xc))(this_00);
        local_4c = *puVar6;
LAB_004d45a2:
        CBaseEntity::TakeDamage(local_84,(CTakeDamageInfo *)&local_7c);
        return;
      }
    }
  }
  if (1.0 <= local_a4) {
    return;
  }
  if ((local_84 != (CBaseEntity *)0x0) &&
     (cVar5 = (**(code **)(*(int *)local_84 + 0x16c))(local_84), cVar5 != '\0')) {
    return;
  }
  uVar9 = *(uint *)(this_00 + 0x2a48);
  fVar14 = ABS(local_b4 * local_e8 + local_b8 * local_ec + local_b0 * local_e4);
  if ((((uVar9 == 0xffffffff) ||
       (puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar12 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar12 + 8) != uVar9 >> 0xc)) || (*(int *)(puVar12 + 4) == 0)) {
    if (fVar14 < *(float *)(z_charge_impact_angle._28_4_ + 0x2c) ||
        fVar14 == *(float *)(z_charge_impact_angle._28_4_ + 0x2c)) {
      return;
    }
    iVar8 = 0;
    do {
      if (this[iVar8 + 0x49c] != (CCharge)0x0) goto LAB_004d4695;
      iVar8 = iVar8 + 1;
    } while (iVar8 != 8);
    ImpactStagger(this);
LAB_004d4695:
    CBaseEntity::EmitSound(this_00,"ChargerZombie.ImpactHard",0.0,(float *)0x0);
    puVar6 = (undefined4 *)(**(code **)(*(int *)this_00 + 0x288))(this_00);
    DispatchParticleEffect
              ("charger_wall_impact",*puVar6,puVar6[1],puVar6[2],vec3_angle,DAT_01053d40,
               DAT_01053d44,0,0,0xffffffff);
    EndCharge(this);
    ImpactRumble(this);
    return;
  }
  fVar14 = *(float *)(this + 0x4b0);
  if (((byte)this_00[0x14d] & 8) == 0) {
    bVar11 = 360.0 < fVar14 - *(float *)(this_00 + 0x2e8);
  }
  else {
    CBaseEntity::CalcAbsolutePosition(this_00);
    uVar9 = *(uint *)(this_00 + 0x2a48);
    bVar11 = 360.0 < fVar14 - *(float *)(this_00 + 0x2e8);
    pCVar10 = (CTerrorPlayer *)0x0;
    if (uVar9 == 0xffffffff) goto LAB_004d48f4;
  }
  puVar12 = g_pEntityList + (uVar9 & 0xfff) * 0x10;
  if ((puVar12 == (undefined *)0xfffffffc) || (*(uint *)(puVar12 + 8) != uVar9 >> 0xc)) {
    pCVar10 = (CTerrorPlayer *)0x0;
  }
  else {
    pCVar10 = *(CTerrorPlayer **)(puVar12 + 4);
  }
LAB_004d48f4:
  CTerrorPlayer::OnSlammedSurvivor((CTerrorPlayer *)this_00,pCVar10,true,bVar11);
  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)