summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-08-21 19:10:14 +0200
committerBardur Arantsson <bardur@scientician.net>2015-09-14 05:58:27 +0200
commit3928bcfc90c4dcdeaa91aade191d4b4c7ae7d0ef (patch)
treea7382700411c10ffd70453233d05b39b17b93dff
parentbaa22bb096d08b6304b0dada144fec128ac69974 (diff)
Use magik() instead of explicitly using rand_int()
-rw-r--r--src/melee2.cc2
-rw-r--r--src/monster2.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/melee2.cc b/src/melee2.cc
index e62b72bb..05d91f3c 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -329,7 +329,7 @@ static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
if (smart_learn)
{
/* Hack -- Occasionally forget player status */
- if (m_ptr->smart && (rand_int(100) < 1)) m_ptr->smart = 0L;
+ if (m_ptr->smart && magik(1)) m_ptr->smart = 0L;
/* Use the memorized flags */
smart = m_ptr->smart;
diff --git a/src/monster2.cc b/src/monster2.cc
index fe5d8ac1..513ebf03 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -3840,7 +3840,7 @@ void update_smart_learn(int m_idx, int what)
if (r_ptr->flags2 & (RF2_STUPID)) return;
/* Not intelligent, only learn sometimes */
- if (!(r_ptr->flags2 & (RF2_SMART)) && (rand_int(100) < 50)) return;
+ if (!(r_ptr->flags2 & (RF2_SMART)) && magik(50)) return;
/* XXX XXX XXX */