L L4D2node

InfectedDying::TryToStartDeathThroes

0x00a32260 · 2344 bytes · __thiscall

_ZN13InfectedDying21TryToStartDeathThroesEP8Infected

Decompiled

undefined (2 params)

/* InfectedDying::TryToStartDeathThroes(Infected*) */

undefined4 __thiscall InfectedDying::TryToStartDeathThroes(InfectedDying *this,Infected *param_1)

{
  CBaseEdict *this_00;
  uint uVar1;
  char cVar2;
  int *piVar3;
  int *piVar4;
  undefined *puVar5;
  int *piVar6;
  undefined4 uVar7;
  int iVar8;
  int iVar9;
  uint uVar10;
  InfectedDying *pIVar11;
  CBaseEntity *this_01;
  int iVar12;
  float *pfVar13;
  byte bVar14;
  longdouble lVar15;
  float fVar16;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  Vector local_34 [8];
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  bVar14 = 0;
  piVar3 = (int *)(**(code **)(*(int *)param_1 + 0x590))(param_1);
  piVar4 = (int *)(**(code **)(*(int *)param_1 + 0x594))(param_1);
  uVar10 = *(uint *)(this + 0x68);
  if ((((uVar10 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar10 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar10 >> 0xc)) ||
     ((this_01 = *(CBaseEntity **)(puVar5 + 4), this_01 == (CBaseEntity *)0x0 ||
      (cVar2 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar2 == '\0')))) {
    this_01 = (CBaseEntity *)0x0;
  }
  else {
    iVar8 = CBaseEntity::GetTeamNumber(this_01);
    if ((iVar8 == 3) && (iVar8 = (**(code **)(*(int *)this_01 + 0x544))(this_01), iVar8 == 8)) {
      return 0;
    }
  }
  uVar10 = *(uint *)(this + 0x7c);
  if ((uVar10 & 0x1000000) != 0) {
    *(float *)(this + 0x34) = *(float *)(this + 0x34) * 20.0;
    *(float *)(this + 0x38) = *(float *)(this + 0x38) * 20.0;
    *(float *)(this + 0x3c) = *(float *)(this + 0x3c) * 20.0;
  }
  if ((uVar10 & 0x1000040) != 0) {
    return 0;
  }
  if ((uVar10 & 0x20000000) != 0) {
    *(float *)(this + 0x34) = *(float *)(this + 0x34) * 10.0;
    *(float *)(this + 0x38) = *(float *)(this + 0x38) * 10.0;
    *(float *)(this + 0x3c) = *(float *)(this + 0x3c) * 10.0;
  }
  if (((this_01 != (CBaseEntity *)0x0) && (*(int *)(param_1 + 0x1838) == 1)) &&
     ((uVar10 & 0x84) == 0)) {
    *(undefined4 *)(this + 0x34) = vec3_origin;
    *(undefined4 *)(this + 0x38) = DAT_01053d4c;
    *(undefined4 *)(this + 0x3c) = DAT_01053d50;
    CBaseAnimating::GetAttachment
              ((CBaseAnimating *)param_1,"Head",(Vector *)&local_40,(QAngle *)local_34);
    uVar10 = *(uint *)(this + 0x68);
    if (uVar10 == 0xffffffff) {
      return 0;
    }
    puVar5 = g_pEntityList + (uVar10 & 0xfff) * 0x10;
    if (puVar5 == (undefined *)0xfffffffc) {
      return 0;
    }
    if (*(uint *)(puVar5 + 8) != uVar10 >> 0xc) {
      return 0;
    }
    piVar3 = *(int **)(puVar5 + 4);
    if (piVar3 == (int *)0x0) {
      return 0;
    }
    (**(code **)(*piVar3 + 0x234))(&local_28,piVar3);
    if (((local_28 - local_40 == *(float *)(param_1 + 0x1cdc)) &&
        (local_24 - local_3c == *(float *)(param_1 + 0x1ce0))) &&
       (local_20 - local_38 == *(float *)(param_1 + 0x1ce4))) {
      return 0;
    }
    if (param_1[0x6c] == (Infected)0x0) {
      this_00 = *(CBaseEdict **)(param_1 + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar8 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar8 + 2) = 0;
      }
    }
    else {
      param_1[0x70] = (Infected)((byte)param_1[0x70] | 1);
    }
    *(float *)(param_1 + 0x1cdc) = local_28 - local_40;
    *(float *)(param_1 + 0x1ce0) = local_24 - local_3c;
    *(float *)(param_1 + 0x1ce4) = local_20 - local_38;
    return 0;
  }
  cVar2 = IsStumbling(this,param_1);
  if (cVar2 != '\0') {
    if (((byte)param_1[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_1);
    }
    if (100.0 < *(float *)(param_1 + 0x27c) * *(float *)(param_1 + 0x27c) +
                *(float *)(param_1 + 0x278) * *(float *)(param_1 + 0x278) +
                *(float *)(param_1 + 0x274) * *(float *)(param_1 + 0x274)) {
      return 0;
    }
  }
  piVar6 = (int *)(**(code **)(*(int *)param_1 + 0x590))(param_1);
  cVar2 = (**(code **)(*piVar6 + 0xf8))(piVar6);
  if (cVar2 == '\0') {
    return 0;
  }
  if (piVar3 != (int *)0x0) {
    cVar2 = (**(code **)(*piVar3 + 0xf8))(piVar3);
    if (cVar2 == '\0') {
      return 0;
    }
    cVar2 = (**(code **)(*piVar3 + 0x114))(piVar3);
    if (cVar2 != '\0') {
      return 0;
    }
  }
  if (piVar4 == (int *)0x0) {
    return 0;
  }
  cVar2 = (**(code **)(*piVar4 + 0x100))(piVar4,0);
  if (cVar2 == '\0') {
    return 0;
  }
  uVar7 = (**(code **)(*piVar4 + 0x108))(piVar4);
  if ((char)uVar7 != '\0') {
    return 0;
  }
  iVar8 = CBaseAnimating::LookupBone((CBaseAnimating *)param_1,"ValveBiped.bip01_pelvis");
  if (-1 < iVar8) {
    CBaseAnimating::GetBonePosition((CBaseAnimating *)param_1,iVar8,local_34,(QAngle *)&local_28);
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    }
    if (local_2c - *(float *)(param_1 + 0x2e8) < 24.0) {
      return uVar7;
    }
  }
  iVar12 = 0;
  iVar8 = -1;
  uVar7 = CBaseEntity::GetGender((CBaseEntity *)param_1);
  piVar3 = (int *)GetDamageCutoutInfoArray(uVar7);
  do {
    iVar9 = Infected::GetRequestedWound(param_1,iVar12);
    if ((iVar9 != -1) &&
       (iVar9 = Infected::GetRequestedWound(param_1,iVar12),
       *(char *)(iVar9 * 0xf6c + *piVar3 + 0x544) != '\0')) {
      iVar9 = Infected::GetRequestedWound(param_1,iVar12);
      iVar9 = _V_strcmp((char *)(iVar9 * 0xf6c + *piVar3 + 0x544),"none");
      if (iVar9 == 0) {
        return 0;
      }
      if (iVar8 == -1) {
        iVar8 = Infected::GetRequestedWound(param_1,iVar12);
        iVar8 = ActivityList_IndexForName((char *)(iVar8 * 0xf6c + *piVar3 + 0x544));
        *(undefined4 *)(this + 0x94) = 0;
      }
    }
    iVar12 = iVar12 + 1;
  } while (iVar12 != 2);
  if (iVar8 != -1) goto LAB_00a324ae;
  uVar10 = *(uint *)(this + 0x7c);
  if (((((uVar10 & 0x20000000) != 0) && (uVar1 = *(uint *)(this + 0x68), uVar1 != 0xffffffff)) &&
      (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc &&
      (piVar3 = *(int **)(puVar5 + 4), piVar3 != (int *)0x0)))) {
    cVar2 = (**(code **)(*piVar3 + 0x16c))(piVar3);
    if ((cVar2 == '\0') ||
       (cVar2 = (**(code **)(*(int *)(param_1 + 0x1a3c) + 0x114))
                          (param_1 + 0x1a3c,piVar3,0x43fa0000), cVar2 == '\0')) {
      uVar10 = *(uint *)(this + 0x7c);
    }
    else {
      if (((byte)param_1[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
      }
      AngleVectors((QAngle *)(param_1 + 0x37c),(Vector *)&local_4c,(Vector *)&local_40,local_34);
      pIVar11 = this + 0x34;
      pfVar13 = &local_28;
      for (iVar8 = 3; iVar8 != 0; iVar8 = iVar8 + -1) {
        *pfVar13 = *(float *)pIVar11;
        pIVar11 = pIVar11 + (uint)bVar14 * -8 + 4;
        pfVar13 = pfVar13 + (uint)bVar14 * -2 + 1;
      }
      VectorNormalize((Vector *)&local_28);
      fVar16 = local_48 * local_24 + local_4c * local_28 + local_44 * local_20;
      if (fVar16 < -0.707) {
        iVar8 = 0x29e;
        *(undefined4 *)(this + 0x94) = 0;
        goto LAB_00a324ae;
      }
      if (0.707 < fVar16) {
        iVar8 = 0x29f;
        *(undefined4 *)(this + 0x94) = 0;
        goto LAB_00a324ae;
      }
      fVar16 = local_24 * local_3c + local_28 * local_40 + local_20 * local_38;
      if (fVar16 < -0.707) {
        *(undefined4 *)(this + 0x94) = 0;
        iVar8 = 0x2a0;
        goto LAB_00a324ae;
      }
      if (0.707 < fVar16) {
        *(undefined4 *)(this + 0x94) = 0;
        iVar8 = 0x2a1;
        goto LAB_00a324ae;
      }
      uVar10 = *(uint *)(this + 0x7c);
    }
  }
  if ((((uVar10 & 0x84) != 0) && (uVar10 = *(uint *)(this + 0x68), uVar10 != 0xffffffff)) &&
     ((puVar5 = g_pEntityList + (uVar10 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc &&
      (((*(uint *)(puVar5 + 8) == uVar10 >> 0xc &&
        (piVar3 = *(int **)(puVar5 + 4), piVar3 != (int *)0x0)) &&
       (cVar2 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar2 != '\0')))))) {
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    }
    AngleVectors((QAngle *)(param_1 + 0x37c),(Vector *)&local_4c,(Vector *)&local_40,local_34);
    pIVar11 = this + 0x58;
    pfVar13 = &local_28;
    for (iVar8 = 3; iVar8 != 0; iVar8 = iVar8 + -1) {
      *pfVar13 = *(float *)pIVar11;
      pIVar11 = pIVar11 + (uint)bVar14 * -8 + 4;
      pfVar13 = pfVar13 + (uint)bVar14 * -2 + 1;
    }
    local_20 = 0.0;
    VectorNormalize((Vector *)&local_28);
    fVar16 = local_48 * local_24 + local_4c * local_28 + local_44 * local_20;
    if (fVar16 < -0.707) {
      iVar8 = (-(uint)((*(uint *)(this + 0x7c) & 0x80) == 0) & 4) + 0x2a2;
      *(undefined4 *)(this + 0x94) = 0;
      goto LAB_00a324ae;
    }
    if (0.707 < fVar16) {
      iVar8 = (-(uint)((*(uint *)(this + 0x7c) & 0x80) == 0) & 4) + 0x2a3;
      *(undefined4 *)(this + 0x94) = 0;
      goto LAB_00a324ae;
    }
    fVar16 = local_24 * local_3c + local_28 * local_40 + local_20 * local_38;
    if (fVar16 < -0.707) {
      iVar8 = (-(uint)((*(uint *)(this + 0x7c) & 0x80) == 0) & 4) + 0x2a4;
      *(undefined4 *)(this + 0x94) = 0;
      goto LAB_00a324ae;
    }
    if (0.707 < fVar16) {
      iVar8 = (-(uint)((*(uint *)(this + 0x7c) & 0x80) == 0) & 4) + 0x2a5;
      *(undefined4 *)(this + 0x94) = 0;
      goto LAB_00a324ae;
    }
  }
  if (((byte)param_1[0x14d] & 0x10) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_1);
  }
  if (22500.0 < *(float *)(param_1 + 0x278) * *(float *)(param_1 + 0x278) +
                *(float *)(param_1 + 0x274) * *(float *)(param_1 + 0x274) +
                *(float *)(param_1 + 0x27c) * *(float *)(param_1 + 0x27c)) {
    iVar8 = 0x29d;
    lVar15 = (longdouble)RandomFloat(0xc28c0000,0x428c0000);
    *(float *)(this + 0x94) = (float)lVar15;
  }
  else {
    iVar8 = 0x29b;
    *(undefined4 *)(this + 0x94) = 0;
  }
LAB_00a324ae:
  uVar7 = (**(code **)(*piVar4 + 0xd8))(piVar4,iVar8,5);
  if ((char)uVar7 == '\0') {
    return 0;
  }
  *(undefined4 *)(this + 0x34) = vec3_origin;
  *(undefined4 *)(this + 0x38) = DAT_01053d4c;
  *(undefined4 *)(this + 0x3c) = DAT_01053d50;
  return uVar7;
}

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)