Core/Units: a587f99c30 followup

This commit is contained in:
Ovahlord committed 2022-09-13 16:30:15 +02:00
1 parent a587f99c30
commit a7ba9502d7
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -1030,7 +1030,7 @@ void Unit::CastStop(uint32 except_spellid)
InterruptSpell(CurrentSpellTypes(i), false);
}
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit, SpellMissInfo missCondition /*= SPELL_MISS_NONE*/)
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit, bool blocked /*= false*/)
{
if (damage < 0)
return;
@@ -1080,7 +1080,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
}
// Spell weapon based damage CAN BE crit & blocked at same time
if (missCondition == SPELL_MISS_BLOCK)
if (blocked)
{
// double blocked amount if block is critical
uint32 value = victim->GetBlockPercent();
+1 -1
View File
@@ -1049,7 +1049,7 @@ class TC_GAME_API Unit : public WorldObject
void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);
void HandleProcExtraAttackFor(Unit* victim);
void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false, SpellMissInfo missCondition = SPELL_MISS_NONE);
void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false, bool blocked = false);
void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss);
// player or player's pet resilience (-1%)
+1 -1
View File
@@ -2675,7 +2675,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
else
{
// Add bonuses and fill damageInfo struct
caster->CalculateSpellDamageTaken(&damageInfo, spell->m_damage, spell->m_spellInfo, spell->m_attackType, IsCrit);
caster->CalculateSpellDamageTaken(&damageInfo, spell->m_damage, spell->m_spellInfo, spell->m_attackType, IsCrit, MissCondition == SPELL_MISS_BLOCK);
Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
if (Creature* target = damageInfo.target->ToCreature())