• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision24938307ab068c6bd49f37e89e8272a38fd001f9 (tree)
Time2019-07-10 12:25:27
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 player_has_no_spellbooks() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -656,7 +656,7 @@ void do_cmd_browse(void)
656656
657657 if (p_ptr->pclass == CLASS_FORCETRAINER)
658658 {
659- if (player_has_no_spellbooks())
659+ if (player_has_no_spellbooks(p_ptr))
660660 {
661661 confirm_use_force(TRUE);
662662 return;
@@ -1095,7 +1095,7 @@ void do_cmd_cast(void)
10951095
10961096 if (p_ptr->pclass == CLASS_FORCETRAINER)
10971097 {
1098- if (player_has_no_spellbooks())
1098+ if (player_has_no_spellbooks(p_ptr))
10991099 {
11001100 confirm_use_force(FALSE);
11011101 return;
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5109,18 +5109,18 @@ void update_creature(player_type *creature_ptr)
51095109 * @brief プレイヤーが魔道書を一冊も持っていないかを判定する
51105110 * @return 魔道書を一冊も持っていないならTRUEを返す
51115111 */
5112-bool player_has_no_spellbooks(void)
5112+bool player_has_no_spellbooks(player_type *creature_ptr)
51135113 {
51145114 int i;
51155115 object_type *o_ptr;
51165116
51175117 for (i = 0; i < INVEN_PACK; i++)
51185118 {
5119- o_ptr = &p_ptr->inventory_list[i];
5119+ o_ptr = &creature_ptr->inventory_list[i];
51205120 if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
51215121 }
51225122
5123- for (i = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
5123+ for (i = current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
51245124 {
51255125 o_ptr = &current_floor_ptr->o_list[i];
51265126 if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -739,7 +739,7 @@ extern bool is_heavy_shoot(object_type *o_ptr);
739739 extern bool heavy_armor(player_type *creature_ptr);
740740 extern void update_creature(player_type *creature_ptr);
741741 extern BIT_FLAGS16 empty_hands(bool riding_control);
742-extern bool player_has_no_spellbooks(void);
742+extern bool player_has_no_spellbooks(player_type *creature_ptr);
743743
744744 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
745745 extern void free_turn(player_type *creature_ptr);
Show on old repository browser