From 57bb453a15034c67d04496360b306a5f3bfd0bf2 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Wed, 5 Oct 2016 18:45:08 +0200 Subject: Move a_info into GameEditData --- src/wizard2.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/wizard2.cc') diff --git a/src/wizard2.cc b/src/wizard2.cc index 6665102e..e3e93918 100644 --- a/src/wizard2.cc +++ b/src/wizard2.cc @@ -150,20 +150,24 @@ void do_cmd_rerate(void) */ static void wiz_create_named_art() { + auto const &a_info = game->edit_data.a_info; + object_type forge; object_type *q_ptr; int i, a_idx; cptr p = "Number of the artifact: "; char out_val[80] = ""; - artifact_type *a_ptr; if (!get_string(p, out_val, 4)) return; a_idx = atoi(out_val); /* Return if out-of-bounds */ - if ((a_idx <= 0) || (a_idx >= max_a_idx)) return; + if ((a_idx <= 0) || (a_idx >= static_cast(a_info.size()))) + { + return; + } - a_ptr = &a_info[a_idx]; + auto a_ptr = &a_info[a_idx]; /* Get local object */ q_ptr = &forge; @@ -821,6 +825,8 @@ static void wiz_reroll_item(object_type *o_ptr) */ static void wiz_statistics(object_type *o_ptr) { + auto &a_info = game->edit_data.a_info; + long i, matches, better, worse, other; char ch; -- cgit v1.2.3