From 4c6c2793ad06e95479c365ca43125b59e9ec3b3b Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 23 Apr 2019 22:00:09 +0900 Subject: [PATCH] =?utf8?q?[refactor]=20#39076=20/*=20Skip=20non-objects=20?= =?utf8?q?*/=20=E3=82=92=E5=89=8A=E9=99=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd-basic.c | 2 -- src/dungeon.c | 6 ------ src/files.c | 4 ---- src/melee1.c | 6 ------ src/object1.c | 8 -------- src/object2.c | 4 ---- src/player-damage.c | 2 -- src/player-effects.c | 2 -- src/player-status.c | 4 ---- src/save.c | 2 -- src/selfinfo.c | 2 -- src/spells3.c | 4 ---- src/util.c | 2 -- 13 files changed, 48 deletions(-) diff --git a/src/cmd-basic.c b/src/cmd-basic.c index 862e464da..bf5af2d3e 100644 --- a/src/cmd-basic.c +++ b/src/cmd-basic.c @@ -1935,8 +1935,6 @@ static bool get_spike(INVENTORY_IDX *ip) for (i = 0; i < INVEN_PACK; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Check the "tval" code */ diff --git a/src/dungeon.c b/src/dungeon.c index 1d9f101bc..949a81b89 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -2553,8 +2553,6 @@ static void process_world_aux_curse(void) { BIT_FLAGS flgs[TR_FLAG_SIZE]; o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Extract the item flags */ @@ -2779,8 +2777,6 @@ static void process_world_aux_recharge(void) { /* Get the object */ object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Recharge activatable objects */ @@ -2814,8 +2810,6 @@ static void process_world_aux_recharge(void) { object_type *o_ptr = &inventory[i]; object_kind *k_ptr = &k_info[o_ptr->k_idx]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Examine all charging rods or stacks of charging rods. */ diff --git a/src/files.c b/src/files.c index f0bb7f906..d1d7c353d 100644 --- a/src/files.c +++ b/src/files.c @@ -6378,8 +6378,6 @@ void show_info(void) for (i = 0; i < INVEN_TOTAL; i++) { o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Aware and Known */ @@ -6395,8 +6393,6 @@ void show_info(void) for (j = 0; j < st_ptr->stock_num; j++) { o_ptr = &st_ptr->stock[j]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Aware and Known */ diff --git a/src/melee1.c b/src/melee1.c index 5c8fcd2a3..60befd1b6 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -2544,8 +2544,6 @@ bool make_attack_normal(MONSTER_IDX m_idx) /* Obtain the item */ o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Drain charged wands/staffs */ @@ -2679,8 +2677,6 @@ bool make_attack_normal(MONSTER_IDX m_idx) /* Obtain the item */ o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Skip artifacts */ @@ -2757,8 +2753,6 @@ bool make_attack_normal(MONSTER_IDX m_idx) i = (INVENTORY_IDX)randint0(INVEN_PACK); o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Skip non-food objects */ diff --git a/src/object1.c b/src/object1.c index f7dc6a826..9fc8c5dcc 100644 --- a/src/object1.c +++ b/src/object1.c @@ -1639,8 +1639,6 @@ void display_inven(void) for (i = 0; i < INVEN_PACK; i++) { o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Track */ @@ -1852,8 +1850,6 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode) for (i = start; i <= end; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Skip empty inscriptions */ @@ -1897,8 +1893,6 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode) for (i = start; i <= end; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Skip empty inscriptions */ @@ -2137,8 +2131,6 @@ COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode) for (i = 0; i < INVEN_PACK; i++) { o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Track */ diff --git a/src/object2.c b/src/object2.c index f25808252..721f0425a 100644 --- a/src/object2.c +++ b/src/object2.c @@ -5179,8 +5179,6 @@ bool inven_carry_okay(object_type *o_ptr) for (j = 0; j < INVEN_PACK; j++) { object_type *j_ptr = &inventory[j]; - - /* Skip non-objects */ if (!j_ptr->k_idx) continue; /* Check if the two items can be combined */ @@ -5311,8 +5309,6 @@ s16b inven_carry(object_type *o_ptr) for (j = 0; j < INVEN_PACK; j++) { j_ptr = &inventory[j]; - - /* Skip non-objects */ if (!j_ptr->k_idx) continue; /* Hack -- track last item */ diff --git a/src/player-damage.c b/src/player-damage.c index 365966842..8568d0540 100644 --- a/src/player-damage.c +++ b/src/player-damage.c @@ -276,8 +276,6 @@ int inven_damage(inven_func typ, int perc) for (i = 0; i < INVEN_PACK; i++) { o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Hack -- for now, skip artifacts */ diff --git a/src/player-effects.c b/src/player-effects.c index 28159cfb9..a19853ae6 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -3594,8 +3594,6 @@ bool lose_all_info(void) for (i = 0; i < INVEN_TOTAL; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Allow "protection" by the MENTAL flag */ diff --git a/src/player-status.c b/src/player-status.c index 3fcbf1d1d..39a59d125 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -1268,8 +1268,6 @@ void calc_bonuses(void) { int bonus_to_h, bonus_to_d; o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Extract the item flags */ @@ -3846,8 +3844,6 @@ s16b calc_num_fire(object_type *o_ptr) for (i = INVEN_RARM; i < INVEN_TOTAL; i++) { q_ptr = &inventory[i]; - - /* Skip non-objects */ if (!q_ptr->k_idx) continue; /* Do not apply current equip */ diff --git a/src/save.c b/src/save.c index 36b216b8c..3e5fc63e6 100644 --- a/src/save.c +++ b/src/save.c @@ -1424,8 +1424,6 @@ static bool wr_savefile_new(void) for (i = 0; i < INVEN_TOTAL; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Dump index */ diff --git a/src/selfinfo.c b/src/selfinfo.c index b5643361e..98b99f509 100644 --- a/src/selfinfo.c +++ b/src/selfinfo.c @@ -85,8 +85,6 @@ void self_knowledge(void) u32b tflgs[TR_FLAG_SIZE]; o_ptr = &inventory[k]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; object_flags(o_ptr, tflgs); diff --git a/src/spells3.c b/src/spells3.c index 137d43c5c..1985af1eb 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -1592,8 +1592,6 @@ void identify_pack(void) for (i = 0; i < INVEN_TOTAL; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; identify_item(o_ptr); @@ -1642,8 +1640,6 @@ static int remove_curse_aux(int all) for (i = INVEN_RARM; i < INVEN_TOTAL; i++) { object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Uncursed already */ diff --git a/src/util.c b/src/util.c index 0376aa555..11f0a45a0 100644 --- a/src/util.c +++ b/src/util.c @@ -4592,8 +4592,6 @@ void request_command(int shopping) concptr s; object_type *o_ptr = &inventory[i]; - - /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* No inscription */ -- 2.11.0