• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision7f212d127fd65906c4dcca054d171edb177b86b4 (tree)
Time2019-02-12 23:44:56
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 player_place() を player-status.c/h へ移動。 / Move player_place() to player-status.c/h.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -758,7 +758,6 @@ extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
758758 extern void update_smart_learn(MONSTER_IDX m_idx, int what);
759759 extern void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
760760 extern byte get_mspeed(monster_race *r_ptr);
761-extern bool player_place(POSITION y, POSITION x);
762761 extern void monster_drop_carried_objects(monster_type *m_ptr);
763762
764763 /* object1.c */
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -104,6 +104,7 @@
104104 #include "trap.h"
105105 #include "monster.h"
106106 #include "quest.h"
107+#include "player-status.h"
107108
108109 int dun_tun_rnd;
109110 int dun_tun_chg;
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -3994,8 +3994,7 @@ bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_ID
39943994 */
39953995 bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
39963996 {
3997- monster_type *m_ptr = &m_list[m_idx];
3998-
3997+ monster_type *m_ptr = &m_list[m_idx];
39993998 POSITION y, x;
40003999
40014000 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)
44624461
44634462
44644463 /*!
4465- * @brief プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX
4466- * @param x 配置先X座標
4467- * @param y 配置先Y座標
4468- * @return 配置に成功したらTRUE
4469- */
4470-bool player_place(POSITION y, POSITION x)
4471-{
4472- /* Paranoia XXX XXX */
4473- if (grid_array[y][x].m_idx != 0) return FALSE;
4474-
4475- /* Save player location */
4476- p_ptr->y = y;
4477- p_ptr->x = x;
4478-
4479- /* Success */
4480- return TRUE;
4481-}
4482-
4483-
4484-/*!
44854464 * @brief モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster
44864465 * @param m_ptr モンスター参照ポインタ
44874466 * @return なし
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -3822,3 +3822,22 @@ void free_turn(player_type *creature_ptr)
38223822 {
38233823 creature_ptr->energy_use = 0;
38243824 }
3825+
3826+/*!
3827+ * @brief プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX
3828+ * @param x 配置先X座標
3829+ * @param y 配置先Y座標
3830+ * @return 配置に成功したらTRUE
3831+ */
3832+bool player_place(POSITION y, POSITION x)
3833+{
3834+ /* Paranoia XXX XXX */
3835+ if (grid_array[y][x].m_idx != 0) return FALSE;
3836+
3837+ /* Save player location */
3838+ p_ptr->y = y;
3839+ p_ptr->x = x;
3840+
3841+ /* Success */
3842+ return TRUE;
3843+}
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -14,4 +14,6 @@ extern BIT_FLAGS16 empty_hands(bool riding_control);
1414 extern bool player_has_no_spellbooks(void);
1515
1616 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
17-extern void free_turn(player_type *creature_ptr);
\ No newline at end of file
17+extern void free_turn(player_type *creature_ptr);
18+
19+extern bool player_place(POSITION y, POSITION x);
Show on old repository browser