aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkaelima <jeppo_meyer@msn.com>2011-05-12 23:22:41 +0200
committerkaelima <jeppo_meyer@msn.com>2011-05-12 23:22:41 +0200
commitb367fc41c27e36273852dedff50a0075cd56881e (patch)
tree3ccae7e652a54782878a8d5ad7bf63a3888836af /src
parentb1d2fbc0c2aec888842030d88b412076cfb49c20 (diff)
Core/Spells: Check SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK before HasInArc in Unit::isSpellBlocked.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 9dd7f853bf0..c2415dd4ad7 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2250,21 +2250,21 @@ void Unit::SendMeleeAttackStop(Unit* victim)
sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
}
-bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * spellProto, WeaponAttackType attackType)
+bool Unit::isSpellBlocked(Unit* victim, SpellEntry const * spellProto, WeaponAttackType attackType)
{
- if (pVictim->HasInArc(M_PI, this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
+ // These spells can't be blocked
+ if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
+ return false;
+
+ if (victim->HasInArc(M_PI, this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
{
// Check creatures flags_extra for disable block
- if (pVictim->GetTypeId() == TYPEID_UNIT &&
- pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
+ if (victim->GetTypeId() == TYPEID_UNIT &&
+ victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
return false;
- // These spells shouldn't be blocked
- if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
- return false;
-
- float blockChance = pVictim->GetUnitBlockChance();
- blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(pVictim->GetMaxSkillValueForLevel()))*0.04f;
+ float blockChance = victim->GetUnitBlockChance();
+ blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(victim->GetMaxSkillValueForLevel())) * 0.04f;
if (roll_chance_f(blockChance))
return true;
}