OSDN Git Service

[Feature] #37285 追加モンスターのフラグ修正。 / Adjust flag of a added monster.
[hengband/hengband.git] / src / object2.c
index 5c82dce..b800143 100644 (file)
@@ -1989,7 +1989,7 @@ void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx)
        o_ptr->ds = k_ptr->ds;
 
        /* Default activation */
-       if (k_ptr->act_idx > 0) o_ptr->xtra2 = k_ptr->act_idx;
+       if (k_ptr->act_idx > 0) o_ptr->xtra2 = (XTRA8)k_ptr->act_idx;
 
        /* Hack -- worthless items are always "broken" */
        if (k_info[o_ptr->k_idx].cost <= 0) o_ptr->ident |= (IDENT_BROKEN);
@@ -3123,7 +3123,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                        o_ptr->to_d -= 6;
                                        o_ptr->to_h -= 6;
                                        break;
-                                 case EGO_NAZGUL:
+                               case EGO_NAZGUL:
                                        o_ptr->to_d -= 3;
                                        o_ptr->to_h -= 3;
                                        if (one_in_(3)) add_flag(o_ptr->art_flags, TR_COWARDICE);
@@ -4537,7 +4537,7 @@ void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
                }
 
                /* Hack -- apply activatin index if needed */
-               if (e_ptr->act_idx) o_ptr->xtra2 = e_ptr->act_idx;
+               if (e_ptr->act_idx) o_ptr->xtra2 = (XTRA8)e_ptr->act_idx;
 
                /* Hack -- apply extra penalties if needed */
                if ((object_is_cursed(o_ptr) || object_is_broken(o_ptr)) && !(e_ptr->gen_flags & (TRG_POWERFUL)))
@@ -4777,7 +4777,6 @@ static bool kind_is_good(KIND_OBJECT_IDX k_idx)
 bool make_object(object_type *j_ptr, BIT_FLAGS mode)
 {
        int prob, base;
-       DEPTH obj_level;
 
 
        /* Chance of "special object" */
@@ -4838,9 +4837,6 @@ bool make_object(object_type *j_ptr, BIT_FLAGS mode)
                }
        }
 
-       obj_level = k_info[j_ptr->k_idx].level;
-       if (object_is_fixed_artifact(j_ptr)) obj_level = a_info[j_ptr->name1].level;
-
        if (cheat_peek) object_mention(j_ptr);
 
        /* Success */
@@ -7262,7 +7258,7 @@ static bool item_tester_hook_melee_ammo(object_type *o_ptr)
 typedef struct {
        int add;       /* TR flag number or special essence id */
        cptr add_name; /* Name of this ability */
-       int type;      /* Menu number */
+       ESSENCE_IDX type;      /* Menu number */
        int essence;   /* Index for carrying essences */
        int value;     /* Needed value to add this ability */
 } essence_type;
@@ -8095,7 +8091,7 @@ static COMMAND_CODE choose_essence(void)
  * @param mode エッセンスの大別ID
  * @return なし
  */
-static void add_essence(int mode)
+static void add_essence(ESSENCE_IDX mode)
 {
        OBJECT_IDX item;
        int max_num = 0;
@@ -8142,7 +8138,7 @@ static void add_essence(int mode)
        choice = (always_show_list || use_menu) ? ESCAPE:1;
        while (!flag)
        {
-               bool able[22];
+               bool able[22] = {0};
                if( choice==ESCAPE ) choice = ' '; 
                else if( !get_com(out_val, &choice, FALSE) )break;