summaryrefslogtreecommitdiff
path: root/src/wizard2.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-10-05 18:45:08 +0200
committerBardur Arantsson <bardur@scientician.net>2016-10-05 18:49:37 +0200
commit0c2f30b56c221a826ba64f0ec864c29d0f717644 (patch)
treea7b38e7b9cf9a06aacd56ec8a7177d44d001c1df /src/wizard2.cc
parent5ddcbbf1cdce68e565376819efedd519892512ad (diff)
Move r_info into GameEditData
Diffstat (limited to 'src/wizard2.cc')
-rw-r--r--src/wizard2.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wizard2.cc b/src/wizard2.cc
index b2713636..575b6e72 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -1399,15 +1399,17 @@ static void do_cmd_wiz_summon(int num)
*
* XXX XXX XXX This function is rather dangerous
*/
-static void do_cmd_wiz_named(int r_idx, bool_ slp)
+static void do_cmd_wiz_named(std::size_t r_idx, bool_ slp)
{
+ auto const &r_info = game->edit_data.r_info;
+
int i, x, y;
/* Paranoia */
/* if (!r_idx) return; */
/* Prevent illegal monsters */
- if (r_idx >= max_r_idx) return;
+ if (r_idx >= r_info.size()) return;
/* Try 10 times */
for (i = 0; i < 10; i++)
@@ -1439,15 +1441,17 @@ static void do_cmd_wiz_named(int r_idx, bool_ slp)
*
* XXX XXX XXX This function is rather dangerous
*/
-void do_cmd_wiz_named_friendly(int r_idx, bool_ slp)
+void do_cmd_wiz_named_friendly(std::size_t r_idx, bool_ slp)
{
+ auto const &r_info = game->edit_data.r_info;
+
int i, x, y;
/* Paranoia */
/* if (!r_idx) return; */
/* Prevent illegal monsters */
- if (r_idx >= max_r_idx) return;
+ if (r_idx >= r_info.size()) return;
/* Try 10 times */
for (i = 0; i < 10; i++)
@@ -1500,6 +1504,8 @@ static void do_cmd_wiz_body(s16b bidx)
/* Might create problems with equipment slots. For safety,
be nude when calling this function */
{
+ auto const &r_info = game->edit_data.r_info;
+
p_ptr->body_monster = bidx;
p_ptr->disembodied = FALSE;
p_ptr->chp = maxroll( (&r_info[bidx])->hdice, (&r_info[bidx])->hside);