Core/Units: removed deprecated fake attacker state update from the core

This commit is contained in:
Ovahlord committed 2021-11-17 17:18:05 +01:00
1 parent 7840a8f529
commit 373a296b8d
5 files changed
+3 -72

No files matched your search

-52
View File
@@ -2121,49 +2121,6 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
}
}
void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BASE_ATTACK*/)
{
if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
return;
if (!victim->IsAlive())
return;
if ((attType == BASE_ATTACK || attType == OFF_ATTACK) && !IsWithinLOSInMap(victim))
return;
AtTargetAttacked(victim, true);
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::Attacking);
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
return; // ignore ranged case
if (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED) && !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISABLE_TURN))
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
CalcDamageInfo damageInfo;
damageInfo.attacker = this;
damageInfo.target = victim;
damageInfo.damageSchoolMask = GetMeleeDamageSchoolMask();
damageInfo.attackType = attType;
damageInfo.damage = 0;
damageInfo.cleanDamage = 0;
damageInfo.absorb = 0;
damageInfo.resist = 0;
damageInfo.blocked_amount = 0;
damageInfo.TargetState = VICTIMSTATE_HIT;
damageInfo.HitInfo = HITINFO_AFFECTS_VICTIM | HITINFO_NORMALSWING | HITINFO_FAKE_DAMAGE;
if (attType == OFF_ATTACK)
damageInfo.HitInfo |= HITINFO_OFFHAND;
damageInfo.procAttacker = PROC_FLAG_NONE;
damageInfo.procVictim = PROC_FLAG_NONE;
damageInfo.hitOutCome = MELEE_HIT_NORMAL;
SendAttackStateUpdate(&damageInfo);
}
void Unit::HandleProcExtraAttackFor(Unit* victim)
{
while (m_extraAttacks)
@@ -13471,8 +13428,6 @@ void Unit::_ExitVehicle(Position const* exitPosition)
else
ToTempSummon()->UnSummon(2000); // Approximation
}
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::AbandonVehicle);
}
bool Unit::IsFalling() const
@@ -13803,13 +13758,6 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
_positionUpdateInfo.Relocated = relocated;
_positionUpdateInfo.Turned = turn;
bool isInWater = IsInWater();
if (!IsFalling() || isInWater || IsFlying())
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::Ground);
if (isInWater)
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::Swimming);
return (relocated || turn);
}