aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-01 02:47:58 +0200
committerQAston <none@none>2009-08-01 02:47:58 +0200
commit00724b0b4f703bd7566cea25c7912aeb0646d3f8 (patch)
treedc56c0320fc21822d5f2d4a7804507526594b3b2 /src
parentbf326cd3a3b384881bf124f7c8ae987bc9ac583e (diff)
*Check in spell block chance calc to prevent return unexpected value - by thenecromancer.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/Unit.cpp2
2 files changed, 3 insertions, 1 deletions
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)