From ea187036acd2f9c7394816d358f16d104f96f561 Mon Sep 17 00:00:00 2001 From: nothere Date: Sat, 11 Oct 2003 06:54:48 +0000 Subject: [PATCH] =?utf8?q?=E7=89=B9=E5=AE=9A=E3=83=A2=E3=83=B3=E3=82=B9?= =?utf8?q?=E3=82=BF=E3=83=BC=E3=81=8C=E8=90=BD=E3=81=A8=E3=81=99=E7=89=B9?= =?utf8?q?=E5=AE=9A=E6=96=87=E5=AD=97=E9=99=90=E5=AE=9A=E3=81=AE=E3=82=A2?= =?utf8?q?=E3=82=A4=E3=83=86=E3=83=A0=E3=81=AE=E5=87=A6=E7=90=86=E3=81=AA?= =?utf8?q?=E3=81=A9=E3=81=A7make=5Fobject()=20=E3=81=AE=E5=89=8D=E3=81=ABg?= =?utf8?q?et=5Fobj=5Fnum=5Fprep()=E3=82=92=E5=91=BC=E3=82=93=E3=81=A7?= =?utf8?q?=E3=81=84=E3=81=9F=E9=83=A8=E5=88=86=E3=82=92=E6=95=B4=E7=90=86?= =?utf8?q?=E3=81=97,=20make=5Fobject()=E5=86=85=E9=83=A8=E3=81=AE=20?= =?utf8?q?=E3=81=BF=E3=81=A7=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E5=87=A6?= =?utf8?q?=E7=90=86=E3=82=82=E8=A1=8C=E3=81=86=E3=82=88=E3=81=86=E3=81=AB?= =?utf8?q?=E5=A4=89=E6=9B=B4.=20get=5Fobj=5Fnum=5Fprep()=E3=81=AFobject2.c?= =?utf8?q?=E3=81=A7=E3=81=97=E3=81=8B=20=E4=BD=BF=E3=82=8F=E3=82=8C?= =?utf8?q?=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=9F=E3=82=81,?= =?utf8?q?=20static=E3=81=AB=E3=81=97=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/externs.h | 1 - src/object2.c | 19 +++++++------------ src/xtra2.c | 15 --------------- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/externs.h b/src/externs.h index c092dd3ff..459c4db8d 100644 --- a/src/externs.h +++ b/src/externs.h @@ -897,7 +897,6 @@ extern void delete_object(int y, int x); extern void compact_objects(int size); extern void wipe_o_list(void); extern s16b o_pop(void); -extern errr get_obj_num_prep(void); extern s16b get_obj_num(int level); extern void object_known(object_type *o_ptr); extern void object_aware(object_type *o_ptr); diff --git a/src/object2.c b/src/object2.c index 5c46d803e..f9ec08bc0 100644 --- a/src/object2.c +++ b/src/object2.c @@ -561,7 +561,7 @@ s16b o_pop(void) /* * Apply a "object restriction function" to the "object allocation table" */ -errr get_obj_num_prep(void) +static errr get_obj_num_prep(void) { int i; @@ -4617,31 +4617,26 @@ bool make_object(object_type *j_ptr, u32b mode) { int k_idx; - /* - * Hack -- If restriction is already specified, allocation table is - * should be prepared by get_obj_num_prep(). - * We rely previous preparation before reaching here. - */ /* Good objects */ if ((mode & AM_GOOD) && !get_obj_num_hook) { - /* Activate restriction (if already specified, use it) */ + /* Activate restriction (if already specified, use that) */ get_obj_num_hook = kind_is_good; - - /* Prepare allocation table */ - get_obj_num_prep(); } + /* Restricted objects - prepare allocation table */ + if (get_obj_num_hook) get_obj_num_prep(); + /* Pick a random object */ k_idx = get_obj_num(base); - /* Good objects */ + /* Restricted objects */ if (get_obj_num_hook) { /* Clear restriction */ get_obj_num_hook = NULL; - /* Prepare allocation table */ + /* Reset allocation table to default */ get_obj_num_prep(); } diff --git a/src/xtra2.c b/src/xtra2.c index b7e98fa4f..2c33bc041 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -915,9 +915,6 @@ msg_print(" else get_obj_num_hook = kind_is_book; - /* Prepare allocation table */ - get_obj_num_prep(); - /* Make a book */ make_object(q_ptr, mo_mode); @@ -1099,9 +1096,6 @@ msg_print(" /* Activate restriction */ get_obj_num_hook = kind_is_cloak; - /* Prepare allocation table */ - get_obj_num_prep(); - /* Make a cloak */ make_object(q_ptr, mo_mode); @@ -1122,9 +1116,6 @@ msg_print(" /* Activate restriction */ get_obj_num_hook = kind_is_polearm; - /* Prepare allocation table */ - get_obj_num_prep(); - /* Make a poleweapon */ make_object(q_ptr, mo_mode); @@ -1145,9 +1136,6 @@ msg_print(" /* Activate restriction */ get_obj_num_hook = kind_is_armor; - /* Prepare allocation table */ - get_obj_num_prep(); - /* Make a hard armor */ make_object(q_ptr, mo_mode); @@ -1168,9 +1156,6 @@ msg_print(" /* Activate restriction */ get_obj_num_hook = kind_is_sword; - /* Prepare allocation table */ - get_obj_num_prep(); - /* Make a sword */ make_object(q_ptr, mo_mode); -- 2.11.0