From 81bc5423676101389183570fcf2ef759e4ffce80 Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 28 Nov 2018 21:32:06 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=82=B3=E3=83=A1?= =?utf8?q?=E3=83=B3=E3=83=88=E6=95=B4=E7=90=86=20/=20Refactor=20comments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/autopick.c | 2 -- src/bldg.c | 1 - src/cmd-item.c | 1 - src/cmd1.c | 5 ----- src/cmd2.c | 1 - src/monster-process.c | 1 - src/monster2.c | 2 -- src/object1.c | 6 ------ src/object2.c | 3 --- src/spells1.c | 5 +---- src/spells3.c | 3 --- src/store.c | 5 ++--- src/xtra2.c | 9 ++------- 13 files changed, 5 insertions(+), 39 deletions(-) diff --git a/src/autopick.c b/src/autopick.c index d7a7bb56e..1b7839117 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -1727,7 +1727,6 @@ void autopick_pickup_items(cave_type *c_ptr) { char o_name[MAX_NLEN]; - /* Describe the object */ object_desc(o_name, o_ptr, 0); msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name); @@ -1747,7 +1746,6 @@ void autopick_pickup_items(cave_type *c_ptr) continue; } - /* Describe the object */ object_desc(o_name, o_ptr, 0); sprintf(out_val, _("%sを拾いますか? ", "Pick up %s? "), o_name); diff --git a/src/bldg.c b/src/bldg.c index e3c5c8dd1..1fb47002f 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -1999,7 +1999,6 @@ static bool kankin(void) */ item_new = inven_carry(&forge); - /* Describe the object */ object_desc(o_name, &forge, 0); msg_format(_("%s(%c)を貰った。", "You get %s (%c). "), o_name, index_to_label(item_new)); diff --git a/src/cmd-item.c b/src/cmd-item.c index 5c2f9c1f2..58b428283 100644 --- a/src/cmd-item.c +++ b/src/cmd-item.c @@ -870,7 +870,6 @@ void do_cmd_destroy(void) } - /* Describe the object */ old_number = o_ptr->number; o_ptr->number = amt; object_desc(o_name, o_ptr, 0); diff --git a/src/cmd1.c b/src/cmd1.c index 905d784c2..f420d210a 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -475,7 +475,6 @@ void py_pickup_aux(OBJECT_IDX o_idx) o_ptr = &o_list[o_idx]; #ifdef JP - /* Describe the object */ object_desc(old_name, o_ptr, OD_NAME_ONLY); object_desc_kosuu(kazu_str, o_ptr); hirottakazu = o_ptr->number; @@ -486,7 +485,6 @@ void py_pickup_aux(OBJECT_IDX o_idx) /* Get the object again */ o_ptr = &inventory[slot]; - /* Delete the object */ delete_object_idx(o_idx); if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN) @@ -500,7 +498,6 @@ void py_pickup_aux(OBJECT_IDX o_idx) if (o_ptr->marked & OM_AUTODESTROY) return; } - /* Describe the object */ object_desc(o_name, o_ptr, 0); #ifdef JP @@ -596,7 +593,6 @@ void carry(bool pickup) #endif /* ALLOW_EASY_SENSE -- TNB */ - /* Describe the object */ object_desc(o_name, o_ptr, 0); /* Acquire next object */ @@ -636,7 +632,6 @@ void carry(bool pickup) /* Clear the flag. */ o_ptr->marked &= ~OM_NOMSG; } - /* Describe the object */ else if (!pickup) { msg_format(_("%sがある。", "You see %s."), o_name); diff --git a/src/cmd2.c b/src/cmd2.c index 3f6da2866..3d7443dbe 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -2729,7 +2729,6 @@ void do_cmd_fire_aux(INVENTORY_IDX item, object_type *j_ptr) /* Sniper - Cannot shot a single arrow twice */ if ((snipe_type == SP_DOUBLE) && (o_ptr->number < 2)) snipe_type = SP_NONE; - /* Describe the object */ object_desc(o_name, o_ptr, OD_OMIT_PREFIX); /* Use the proper number of shots */ diff --git a/src/monster-process.c b/src/monster-process.c index 178e95b70..5239eab40 100644 --- a/src/monster-process.c +++ b/src/monster-process.c @@ -3223,7 +3223,6 @@ void process_monster(MONSTER_IDX m_idx) msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name); } - /* Delete the object */ delete_object_idx(this_o_idx); } } diff --git a/src/monster2.c b/src/monster2.c index d2051b6d8..b4b3c739f 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -278,7 +278,6 @@ void delete_monster_idx(MONSTER_IDX i) * to prevent calling lite_spot() */ - /* Delete the object */ delete_object_idx(this_o_idx); } @@ -4582,7 +4581,6 @@ void monster_drop_carried_objects(monster_type *m_ptr) /* Forget monster */ q_ptr->held_m_idx = 0; - /* Delete the object */ delete_object_idx(this_o_idx); /* Drop it */ diff --git a/src/object1.c b/src/object1.c index fb3f6bc14..5767b77ad 100644 --- a/src/object1.c +++ b/src/object1.c @@ -2184,7 +2184,6 @@ COMMAND_CODE show_inven(int target_item) /* Is this item acceptable? */ if (!item_tester_okay(o_ptr)) continue; - /* Describe the object */ object_desc(o_name, o_ptr, 0); /* Save the object index, color, and description */ @@ -3624,7 +3623,6 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w { o_ptr = &o_list[floor_list[i]]; - /* Describe the object */ object_desc(o_name, o_ptr, 0); /* Save the index */ @@ -4984,7 +4982,6 @@ void py_pickup_floor(bool pickup) /* Access the object */ o_ptr = &o_list[this_o_idx]; - /* Describe the object */ object_desc(o_name, o_ptr, 0); /* Access the next object */ @@ -5063,7 +5060,6 @@ void py_pickup_floor(bool pickup) #endif /* ALLOW_EASY_SENSE */ - /* Describe the object */ object_desc(o_name, o_ptr, 0); msg_format(_("%sがある。", "You see %s."), o_name); @@ -5098,7 +5094,6 @@ void py_pickup_floor(bool pickup) #endif /* ALLOW_EASY_SENSE */ - /* Describe the object */ object_desc(o_name, o_ptr, 0); msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name); @@ -5136,7 +5131,6 @@ void py_pickup_floor(bool pickup) #endif /* ALLOW_EASY_SENSE */ - /* Describe the object */ object_desc(o_name, o_ptr, 0); /* Build a prompt */ diff --git a/src/object2.c b/src/object2.c index fb8e31569..e359495c4 100644 --- a/src/object2.c +++ b/src/object2.c @@ -437,7 +437,6 @@ void compact_objects(int size) /* Apply the saving throw */ if (randint0(100) < chance) continue; - /* Delete the object */ delete_object_idx(i); /* Count it */ @@ -5916,7 +5915,6 @@ void floor_item_optimize(INVENTORY_IDX item) /* Only optimize empty items */ if (o_ptr->number) return; - /* Delete the object */ delete_object_idx(item); } @@ -6221,7 +6219,6 @@ INVENTORY_IDX inven_takeoff(INVENTORY_IDX item, ITEM_NUMBER amt) /* Modify quantity */ q_ptr->number = amt; - /* Describe the object */ object_desc(o_name, q_ptr, 0); /* Took off weapon */ diff --git a/src/spells1.c b/src/spells1.c index 5d0294036..7e362f6d8 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -753,7 +753,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_GRAVITY: message = _("粉砕された", "was crushed."); break; default: - message = NULL;break; + message = NULL; break; } if (message) { @@ -1559,9 +1559,6 @@ static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P k_idx = o_ptr->k_idx; is_potion = object_is_potion(o_ptr); - - - /* Delete the object */ delete_object_idx(this_o_idx); /* Potions produce effects when 'shattered' */ diff --git a/src/spells3.c b/src/spells3.c index 6ab3bd7cd..5ec27e9d7 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -990,7 +990,6 @@ bool apply_disenchant(BIT_FLAGS mode) } - /* Describe the object */ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); @@ -1972,7 +1971,6 @@ bool alchemy(void) } - /* Describe the object */ old_number = o_ptr->number; o_ptr->number = amt; object_desc(o_name, o_ptr, 0); @@ -4477,7 +4475,6 @@ bool polymorph_monster(POSITION y, POSITION x) /* Acquire next object */ next_o_idx = o_list[this_o_idx].next_o_idx; - /* Delete the object */ delete_object_idx(this_o_idx); } } diff --git a/src/store.c b/src/store.c index c5e93a47b..4db960173 100644 --- a/src/store.c +++ b/src/store.c @@ -2285,18 +2285,17 @@ static void display_entry(int pos) /* Leave room for weights, if necessary -DRS- */ if (show_weights) maxwid -= 10; - /* Describe the object */ object_desc(o_name, o_ptr, 0); o_name[maxwid] = '\0'; c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col); /* Show weights */ - if (show_weights) + if(show_weights) { /* Only show the weight of an individual item */ int wgt = o_ptr->weight; #ifdef JP - sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) ); + sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt)); put_str(out_val, i+6, 67); #else (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10); diff --git a/src/xtra2.c b/src/xtra2.c index c18b23381..de4704b38 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -3153,7 +3153,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* Obtain an object description */ object_desc(o_name, o_ptr, 0); - /* Describe the object */ #ifdef JP sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info); #else @@ -3198,15 +3197,12 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* Acquire object */ o_ptr = &o_list[floor_list[0]]; - /* Describe the object */ object_desc(o_name, o_ptr, 0); #ifdef JP - sprintf(out_val, "%s%s%s%s[%s]", - s1, o_name, s2, s3, info); + sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info); #else - sprintf(out_val, "%s%s%s%s [%s]", - s1, s2, s3, o_name, info); + sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, o_name, info); #endif prt(out_val, 0, 0); @@ -3327,7 +3323,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* Obtain an object description */ object_desc(o_name, o_ptr, 0); - /* Describe the object */ #ifdef JP sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info); #else -- 2.11.0