From 00724b0b4f703bd7566cea25c7912aeb0646d3f8 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 1 Aug 2009 02:47:58 +0200 Subject: *Check in spell block chance calc to prevent return unexpected value - by thenecromancer. --HG-- branch : trunk --- src/game/Player.cpp | 2 +- src/game/Unit.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index cc36be390d7..6ede76af68e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -21399,7 +21399,7 @@ void Player::ResetMap() GetMapRef().unlink(); } -void SetMap(Map * map) +void Player::SetMap(Map * map) { Unit::SetMap(map); m_mapRef.link(map, this); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2e3ce92d00c..58237a092dd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2868,6 +2868,8 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (canBlock) { int32 blockChance = int32(pVictim->GetUnitBlockChance()*100.0f) - skillDiff * 4; + if ( blockChance < 0 ) + blockChance = 0; tmp += blockChance; if (roll < tmp) -- cgit v1.2.3