L L4D2node

CTerrorPlayer::OnShovedBySurvivor

0x009b9210 · 2677 bytes · __thiscall

_ZN13CTerrorPlayer18OnShovedBySurvivorEPS_RK6Vector.part.728

Decompiled

undefined (3 params)

/* CTerrorPlayer::OnShovedBySurvivor(CTerrorPlayer*, Vector const&) [clone .part.728] */

void __thiscall
CTerrorPlayer::OnShovedBySurvivor(CTerrorPlayer *this,CTerrorPlayer *param_1,Vector *param_2)

{
  uint uVar1;
  int *piVar2;
  CBaseEdict *pCVar3;
  bool bVar4;
  char cVar5;
  CTerrorPlayer *in_EAX;
  int iVar6;
  int iVar7;
  float *pfVar8;
  float *in_ECX;
  CBaseCombatCharacter *in_EDX;
  undefined *puVar9;
  bool bVar10;
  byte bVar11;
  longdouble lVar12;
  float fVar13;
  undefined4 uVar14;
  undefined4 local_118;
  float local_114;
  float local_100;
  float local_fc;
  float local_f8;
  QAngle local_f4 [4];
  float local_f0;
  float local_e8;
  float local_e4;
  float local_e0;
  Vector local_dc [12];
  float local_d0;
  float local_cc;
  float local_c8;
  float local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  undefined1 local_a8;
  undefined1 local_a7;
  undefined4 local_a0;
  undefined4 local_7c;
  
  bVar11 = 0;
  if ((((in_EDX == (CBaseCombatCharacter *)0x0) ||
       (uVar1 = *(uint *)(in_EDX + 0x3e68), uVar1 == 0xffffffff)) ||
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) {
    bVar10 = false;
  }
  else {
    bVar10 = *(int *)(puVar9 + 4) != 0;
  }
  StopRevivingSomeone(in_EAX,true);
  local_100 = *in_ECX;
  local_fc = in_ECX[1];
  local_f8 = in_ECX[2];
  if (10000.0 < local_fc * local_fc + local_100 * local_100 + local_f8 * local_f8) {
    VectorNormalize((Vector *)&local_100);
    local_100 = local_100 * 100.0;
    local_fc = local_fc * 100.0;
    local_f8 = local_f8 * 100.0;
  }
  local_e0 = 0.0;
  local_e8 = local_100;
  local_e4 = local_fc;
  VectorNormalize((Vector *)&local_e8);
  if (((local_e8 != *(float *)(in_EAX + 0x3208)) || (local_e4 != *(float *)(in_EAX + 0x320c))) ||
     (local_e0 != *(float *)(in_EAX + 0x3210))) {
    if (in_EAX[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(in_EAX + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar6 + 2) = 0;
      }
    }
    else {
      in_EAX[0x70] = (CTerrorPlayer)((byte)in_EAX[0x70] | 1);
    }
    *(float *)(in_EAX + 0x3208) = local_e8;
    *(float *)(in_EAX + 0x320c) = local_e4;
    *(float *)(in_EAX + 0x3210) = local_e0;
  }
  VectorAngles((Vector *)(in_EAX + 0x3208),local_f4);
  local_114 = *(float *)(ZombieHulkMaxStaggerDuration._28_4_ + 0x2c);
  iVar6 = (**(code **)(*(int *)in_EAX + 0x238))();
  lVar12 = (longdouble)AngleNormalize(*(float *)(iVar6 + 4) - local_f0);
  fVar13 = (float)lVar12;
  if (((fVar13 < -45.0) || (local_118 = 0, uVar14 = local_118, 45.0 < fVar13)) &&
     (((135.0 <= fVar13 || (local_118 = 3, uVar14 = local_118, fVar13 <= 45.0)) &&
      ((fVar13 <= -135.0 || (local_118 = 2, uVar14 = local_118, -45.0 <= fVar13)))))) {
    local_118 = 1;
    uVar14 = local_118;
  }
  local_118 = uVar14;
  if ((bVar10) && (iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX), iVar6 == 3)) {
    iVar6 = (**(code **)(*(int *)in_EAX + 0x544))();
    local_118 = 0;
    if (iVar6 != 3) {
      local_118 = uVar14;
    }
  }
  fVar13 = *(float *)(ZombieHulkMaxStaggerDistance._28_4_ + 0x2c);
  if (fVar13 != *(float *)(in_EAX + 0x3214)) {
    if (in_EAX[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(in_EAX + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar6 + 2) = 0;
      }
    }
    else {
      in_EAX[0x70] = (CTerrorPlayer)((byte)in_EAX[0x70] | 1);
    }
    *(float *)(in_EAX + 0x3214) = fVar13;
  }
  if (((byte)in_EAX[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)in_EAX);
  }
  fVar13 = *(float *)(in_EAX + 0x2e0);
  if (((fVar13 != *(float *)(in_EAX + 0x31fc)) ||
      (*(float *)(in_EAX + 0x2e4) != *(float *)(in_EAX + 0x3200))) ||
     (*(float *)(in_EAX + 0x2e8) != *(float *)(in_EAX + 0x3204))) {
    if (in_EAX[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(in_EAX + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar6 + 2) = 0;
        fVar13 = *(float *)(in_EAX + 0x2e0);
      }
    }
    else {
      in_EAX[0x70] = (CTerrorPlayer)((byte)in_EAX[0x70] | 1);
    }
    *(float *)(in_EAX + 0x31fc) = fVar13;
    *(undefined4 *)(in_EAX + 0x3200) = *(undefined4 *)(in_EAX + 0x2e4);
    *(undefined4 *)(in_EAX + 0x3204) = *(undefined4 *)(in_EAX + 0x2e8);
  }
  if (in_EAX[0x3e78] != (CTerrorPlayer)0x0) {
    if (in_EAX[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(in_EAX + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar6 + 2) = 0;
      }
    }
    else {
      in_EAX[0x70] = (CTerrorPlayer)((byte)in_EAX[0x70] | 1);
    }
    in_EAX[0x3e78] = (CTerrorPlayer)0x0;
  }
  bVar4 = false;
  if (in_EAX[0x4014] == (CTerrorPlayer)0x0) {
    iVar6 = CBaseEntity::GetGroundEntity((CBaseEntity *)in_EAX);
    if (iVar6 != 0) {
      uVar14 = 0x44;
      bVar4 = true;
      (**(code **)(*(int *)in_EAX + 0x7fc))();
      (**(code **)(**(int **)(in_EAX + 0x2910) + 0x7c))(*(int **)(in_EAX + 0x2910),uVar14,local_118)
      ;
      iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX);
      goto joined_r0x009b96eb;
    }
    *(undefined4 *)(in_EAX + 0x3218) = local_118;
    SetShoveForce(in_EAX,(Vector *)&local_100);
    SetResponsibleForAirMovement(in_EAX,in_EDX);
    CBaseEntity::SetGroundEntity((CBaseEntity *)in_EAX,(CBaseEntity *)0x0);
  }
  iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX);
joined_r0x009b96eb:
  if ((iVar6 == 3) && (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 == 8)) {
    local_7c = CONCAT13((char)*(undefined4 *)(ZombieHulkStaggerFadeAlpha._28_4_ + 0x30),0xff);
    UTIL_ScreenFade((CBaseEntity *)in_EAX,(color32_s *)&local_7c,
                    *(float *)(ZombieHulkStaggerFadeDuration._28_4_ + 0x2c),0.0,1);
  }
  else if ((bVar10) && (cVar5 = CTerrorGameRules::HasPlayerControlledZombies(), cVar5 != '\0')) {
    local_114 = *(float *)(ZombieHunterPounceStaggerDuration._28_4_ + 0x2c);
  }
  else {
    local_114 = *(float *)(ZombieMaxStaggerDuration._28_4_ + 0x2c);
  }
  if (bVar4) {
    OnStunned(in_EAX,local_114);
    lVar12 = (longdouble)CountdownTimer::Now();
    if ((float)lVar12 + local_114 != *(float *)(in_EAX + 0x31f8)) {
      (**(code **)(*(int *)(in_EAX + 0x31f0) + 4))(in_EAX + 0x31f0,in_EAX + 0x31f8);
      *(float *)(in_EAX + 0x31f8) = (float)lVar12 + local_114;
    }
    if (local_114 != *(float *)(in_EAX + 0x31f4)) {
      (**(code **)(*(int *)(in_EAX + 0x31f0) + 4))(in_EAX + 0x31f0,in_EAX + 0x31f4);
      *(float *)(in_EAX + 0x31f4) = local_114;
    }
  }
  uVar14 = 0;
  (**(code **)(*(int *)in_EAX + 0x7fc))();
  uVar1 = *(uint *)(in_EAX + 0x30bc);
  if (((uVar1 != 0xffffffff) &&
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
      (piVar2 = *(int **)(puVar9 + 4), piVar2 != (int *)0x0)))) {
    iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX);
    if ((iVar6 == 3) && (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 == 8)) {
      (**(code **)(*piVar2 + 900))
                (piVar2,*(undefined4 *)(ZombieHulkMaxStaggerDuration._28_4_ + 0x2c),uVar14);
    }
    else {
      iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX);
      if (((iVar6 == 3) && (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 == 3)) ||
         ((iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX), iVar6 == 3 &&
          (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 == 5)))) {
        (**(code **)(*piVar2 + 900))(piVar2,0x3f000000);
      }
    }
  }
  iVar6 = gpGlobals;
  if ((!bVar10) &&
     ((((iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX), iVar6 == 3 &&
        (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 == 3)) ||
       ((iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX), iVar6 = gpGlobals, iVar7 == 3 &&
        (iVar7 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 = gpGlobals, iVar7 == 1)))) &&
      (iVar6 = gpGlobals, fVar13 = *(float *)(gpGlobals + 0xc),
      fVar13 != *(float *)(in_EAX + 0x3f20))))) {
    if (in_EAX[0x6c] == (CTerrorPlayer)0x0) {
      pCVar3 = *(CBaseEdict **)(in_EAX + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar6 + 2) = 0;
        iVar6 = gpGlobals;
      }
    }
    else {
      in_EAX[0x70] = (CTerrorPlayer)((byte)in_EAX[0x70] | 1);
    }
    *(float *)(in_EAX + 0x3f20) = fVar13;
  }
  CUtlVector<float,CUtlMemory<float,int>>::InsertBefore
            ((CUtlVector<float,CUtlMemory<float,int>> *)(in_EAX + 0x3380),*(int *)(in_EAX + 0x338c),
             (float *)(iVar6 + 0xc));
  iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)in_EAX);
  if (((iVar6 == 3) && (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), 0 < iVar6)) &&
     (iVar6 = (**(code **)(*(int *)in_EAX + 0x544))(), iVar6 < 7)) {
    if (*(int *)(in_EAX + 0x337c) <= *(int *)(in_EAX + 0x338c)) {
      pfVar8 = &local_d0;
      for (iVar6 = 0x15; iVar6 != 0; iVar6 = iVar6 + -1) {
        *pfVar8 = 0.0;
        pfVar8 = pfVar8 + (uint)bVar11 * -2 + 1;
      }
      pfVar8 = (float *)(**(code **)(*(int *)in_EAX + 0x288))();
      local_d0 = *pfVar8;
      local_cc = pfVar8[1];
      local_b4 = -local_e4;
      local_c8 = pfVar8[2];
      local_b8 = -local_e8;
      local_b0 = -local_e0;
      local_ac = local_b4 * local_cc + local_b8 * local_d0 + local_b0 * local_c8;
      local_a8 = 5;
      local_c4 = local_d0;
      local_c0 = local_cc;
      local_bc = local_c8;
      local_a7 = SignbitsForPlane((cplane_t *)&local_b8);
      local_a0 = 0x2000000;
      CTakeDamageInfo::CTakeDamageInfo
                ((CTakeDamageInfo *)&local_7c,(CBaseEntity *)in_EAX,(CBaseEntity *)in_EDX,250.0,0x80
                 ,0);
      (**(code **)(*(int *)in_EDX + 0x478))(local_dc);
      CalculateMeleeDamageForce((CTakeDamageInfo *)&local_7c,(Vector *)&local_e8,local_dc,0.2);
      ClearMultiDamage();
      CBaseEntity::DispatchTraceAttack
                ((CTakeDamageInfo *)in_EAX,(Vector *)&local_7c,(CGameTrace *)&local_e8);
      ApplyMultiDamage();
      return;
    }
    CTakeDamageInfo::CTakeDamageInfo
              ((CTakeDamageInfo *)&local_7c,(CBaseEntity *)in_EAX,(CBaseEntity *)in_EDX,250.0,0x80,0
              );
    EmitInfectedPainSound(in_EAX,(CTakeDamageInfo *)&local_7c);
    return;
  }
  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)