From: Deskull Date: Tue, 12 Feb 2019 14:44:56 +0000 (+0900) Subject: [Refactor] #37353 player_place() を player-status.c/h へ移動。 / Move player_place() to... X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=7f212d127fd65906c4dcca054d171edb177b86b4;p=hengband%2Fhengband.git [Refactor] #37353 player_place() を player-status.c/h へ移動。 / Move player_place() to player-status.c/h. --- diff --git a/src/externs.h b/src/externs.h index 8a24794fa..6d2dd6907 100644 --- 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); 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 */ diff --git a/src/floor-generate.c b/src/floor-generate.c index 82341e8a8..e2a793357 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -104,6 +104,7 @@ #include "trap.h" #include "monster.h" #include "quest.h" +#include "player-status.h" int dun_tun_rnd; int dun_tun_chg; diff --git a/src/monster2.c b/src/monster2.c index c07154741..7630bc4f1 100644 --- 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 */ 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 なし diff --git a/src/player-status.c b/src/player-status.c index 33530c475..46b430fcc 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -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; +} diff --git a/src/player-status.h b/src/player-status.h index 10991db99..5719638ab 100644 --- a/src/player-status.h +++ b/src/player-status.h @@ -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);