OSDN Git Service

[Refactor] #37353 player_place() を player-status.c/h へ移動。 / Move player_place() to...
authorDeskull <deskull@users.sourceforge.jp>
Tue, 12 Feb 2019 14:44:56 +0000 (23:44 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 12 Feb 2019 14:44:56 +0000 (23:44 +0900)
src/externs.h
src/floor-generate.c
src/monster2.c
src/player-status.c
src/player-status.h

index 8a24794..6d2dd69 100644 (file)
@@ -758,7 +758,6 @@ extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
 extern void update_smart_learn(MONSTER_IDX m_idx, int what);
 extern void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
 extern byte get_mspeed(monster_race *r_ptr);
-extern bool player_place(POSITION y, POSITION x);
 extern void monster_drop_carried_objects(monster_type *m_ptr);
 
 /* object1.c */
index 82341e8..e2a7933 100644 (file)
 #include "trap.h"
 #include "monster.h"
 #include "quest.h"
+#include "player-status.h"
 
 int dun_tun_rnd; 
 int dun_tun_chg;
index c071547..7630bc4 100644 (file)
@@ -3994,8 +3994,7 @@ bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_ID
  */
 bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
 {
-       monster_type    *m_ptr = &m_list[m_idx];
-
+       monster_type *m_ptr = &m_list[m_idx];
        POSITION y, x;
 
        if (!mon_scatter(m_ptr->r_idx, &y, &x, m_ptr->fy, m_ptr->fx, 1))
@@ -4462,26 +4461,6 @@ void update_smart_learn(MONSTER_IDX m_idx, int what)
 
 
 /*!
- * @brief プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX
- * @param x 配置先X座標
- * @param y 配置先Y座標
- * @return 配置に成功したらTRUE
- */
-bool player_place(POSITION y, POSITION x)
-{
-       /* Paranoia XXX XXX */
-       if (grid_array[y][x].m_idx != 0) return FALSE;
-
-       /* Save player location */
-       p_ptr->y = y;
-       p_ptr->x = x;
-
-       /* Success */
-       return TRUE;
-}
-
-
-/*!
  * @brief モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster
  * @param m_ptr モンスター参照ポインタ
  * @return なし
index 33530c4..46b430f 100644 (file)
@@ -3822,3 +3822,22 @@ void free_turn(player_type *creature_ptr)
 {
        creature_ptr->energy_use = 0;
 }
+
+/*!
+ * @brief プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX
+ * @param x 配置先X座標
+ * @param y 配置先Y座標
+ * @return 配置に成功したらTRUE
+ */
+bool player_place(POSITION y, POSITION x)
+{
+       /* Paranoia XXX XXX */
+       if (grid_array[y][x].m_idx != 0) return FALSE;
+
+       /* Save player location */
+       p_ptr->y = y;
+       p_ptr->x = x;
+
+       /* Success */
+       return TRUE;
+}
index 10991db..5719638 100644 (file)
@@ -14,4 +14,6 @@ extern BIT_FLAGS16 empty_hands(bool riding_control);
 extern bool player_has_no_spellbooks(void);
 
 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
-extern void free_turn(player_type *creature_ptr);
\ No newline at end of file
+extern void free_turn(player_type *creature_ptr);
+
+extern bool player_place(POSITION y, POSITION x);