• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiona04678418b01b28ab21f0d63482bb4b2fb10460a (tree)
Time2019-08-18 13:22:34
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd/cmd-item.c
+++ b/src/cmd/cmd-item.c
@@ -1486,22 +1486,22 @@ void do_cmd_query_symbol(void)
14861486 * @details
14871487 * XXX - Add actions for other item types
14881488 */
1489-void do_cmd_use(void)
1489+void do_cmd_use(player_type *creature_ptr)
14901490 {
14911491 OBJECT_IDX item;
14921492 object_type *o_ptr;
14931493 concptr q, s;
14941494
1495- if (p_ptr->wild_mode)
1495+ if (creature_ptr->wild_mode)
14961496 {
14971497 return;
14981498 }
14991499
1500- if (cmd_limit_arena(p_ptr)) return;
1500+ if (cmd_limit_arena(creature_ptr)) return;
15011501
1502- if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1502+ if (creature_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
15031503 {
1504- set_action(p_ptr, ACTION_NONE);
1504+ set_action(creature_ptr, ACTION_NONE);
15051505 }
15061506
15071507 item_tester_hook = item_tester_hook_use;
@@ -1509,49 +1509,49 @@ void do_cmd_use(void)
15091509 q = _("どれを使いますか?", "Use which item? ");
15101510 s = _("使えるものがありません。", "You have nothing to use.");
15111511
1512- o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1512+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
15131513 if (!o_ptr) return;
15141514
15151515 switch (o_ptr->tval)
15161516 {
15171517 case TV_SPIKE:
1518- do_cmd_spike(p_ptr);
1518+ do_cmd_spike(creature_ptr);
15191519 break;
15201520
15211521 case TV_FOOD:
1522- exe_eat_food(p_ptr, item);
1522+ exe_eat_food(creature_ptr, item);
15231523 break;
15241524
15251525 case TV_WAND:
1526- exe_aim_wand(p_ptr, item);
1526+ exe_aim_wand(creature_ptr, item);
15271527 break;
15281528
15291529 case TV_STAFF:
1530- exe_use_staff(p_ptr, item);
1530+ exe_use_staff(creature_ptr, item);
15311531 break;
15321532
15331533 case TV_ROD:
1534- exe_zap_rod(p_ptr, item);
1534+ exe_zap_rod(creature_ptr, item);
15351535 break;
15361536
15371537 case TV_POTION:
1538- exe_quaff_potion(p_ptr, item);
1538+ exe_quaff_potion(creature_ptr, item);
15391539 break;
15401540
15411541 case TV_SCROLL:
1542- if (cmd_limit_blind(p_ptr)) return;
1543- if (cmd_limit_confused(p_ptr)) return;
1544- exe_read(p_ptr, item, TRUE);
1542+ if (cmd_limit_blind(creature_ptr)) return;
1543+ if (cmd_limit_confused(creature_ptr)) return;
1544+ exe_read(creature_ptr, item, TRUE);
15451545 break;
15461546
15471547 case TV_SHOT:
15481548 case TV_ARROW:
15491549 case TV_BOLT:
1550- exe_fire(item, &p_ptr->inventory_list[INVEN_BOW], SP_NONE);
1550+ exe_fire(item, &creature_ptr->inventory_list[INVEN_BOW], SP_NONE);
15511551 break;
15521552
15531553 default:
1554- exe_activate(p_ptr, item);
1554+ exe_activate(creature_ptr, item);
15551555 break;
15561556 }
15571557 }
--- a/src/cmd/cmd-item.h
+++ b/src/cmd/cmd-item.h
@@ -14,4 +14,4 @@ extern void do_cmd_target(void);
1414 extern void do_cmd_look(void);
1515 extern void do_cmd_locate(player_type *creature_ptr);
1616 extern void do_cmd_query_symbol(void);
17-extern void do_cmd_use(void);
17+extern void do_cmd_use(player_type *creature_ptr);
--- a/src/core.c
+++ b/src/core.c
@@ -3982,7 +3982,7 @@ static void process_command(void)
39823982 {
39833983 if (use_command && rogue_like_commands)
39843984 {
3985- do_cmd_use();
3985+ do_cmd_use(p_ptr);
39863986 }
39873987 else
39883988 {
@@ -4009,7 +4009,7 @@ static void process_command(void)
40094009 case 'u':
40104010 {
40114011 if (use_command && !rogue_like_commands)
4012- do_cmd_use();
4012+ do_cmd_use(p_ptr);
40134013 else
40144014 do_cmd_use_staff(p_ptr);
40154015 break;
Show on old repository browser