OSDN Git Service

[Fix] #41486 型キャスト追加. / Add type casting.
authordeskull <deskull@users.sourceforge.jp>
Sat, 6 Feb 2021 15:36:06 +0000 (00:36 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 6 Feb 2021 15:36:06 +0000 (00:36 +0900)
src/object-enchant/apply-magic.c

index e1a6cd3..e81baee 100644 (file)
@@ -280,9 +280,9 @@ void apply_magic(player_type *owner_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAG
             if (e_ptr->max_pval)
                 o_ptr->pval -= randint1(e_ptr->max_pval);
         } else {
-            o_ptr->to_h += randint1_signed(e_ptr->max_to_h);
+            o_ptr->to_h += (HIT_PROB)randint1_signed(e_ptr->max_to_h);
             o_ptr->to_d += randint1_signed(e_ptr->max_to_d);
-            o_ptr->to_a += randint1_signed(e_ptr->max_to_a);
+            o_ptr->to_a += (ARMOUR_CLASS)randint1_signed(e_ptr->max_to_a);
 
             if (o_ptr->name2 == EGO_ACCURACY) {
                 while (o_ptr->to_h < o_ptr->to_d + 10) {