OSDN Git Service

[Refactor] #37353 monster.h に関数定義移動。
[hengband/hengband.git] / src / cmd-read.c
index e91ca17..91c70a5 100644 (file)
@@ -15,6 +15,7 @@
 #include "realm-hex.h"
 
 #include "spells-object.h"
+#include "spells-floor.h"
 #include "spells-summon.h"
 #include "spells-status.h"
 
@@ -28,7 +29,7 @@
  * <pre>
  * Certain scrolls can be "aborted" without losing the scroll.  These
  * include scrolls with no effects but recharge or identify, which are
- * cancelled before use.  XXX Reading them still takes a turn, though.
+ * cancelled before use.  XXX Reading them still takes a current_world_ptr->game_turn, though.
  * </pre>
  */
 void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
@@ -46,10 +47,10 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
        /* Get the item (on the floor) */
        else
        {
-               o_ptr = &o_list[0 - item];
+               o_ptr = &current_floor_ptr->o_list[0 - item];
        }
 
-       take_turn(p_ptr, 100);;
+       take_turn(p_ptr, 100);
        if (cmd_limit_time_walk(p_ptr)) return;
 
        if (p_ptr->pclass == CLASS_BERSERKER)
@@ -118,7 +119,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
                {
                        for (k = 0; k < randint1(3); k++)
                        {
-                               if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0'))
+                               if (summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0'))
                                {
                                        ident = TRUE;
                                }
@@ -130,7 +131,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
                {
                        for (k = 0; k < randint1(3); k++)
                        {
-                               if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0'))
+                               if (summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0'))
                                {
                                        ident = TRUE;
                                }
@@ -140,7 +141,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_SUMMON_PET:
                {
-                       if (summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
+                       if (summon_specific(-1, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
                        {
                                ident = TRUE;
                        }