• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb77edeb09e962e484cc5b5aadb7bcf7425cb8850 (tree)
Time2019-06-17 00:24:38
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 count_chests() に player_type * 引数を対象として追加.

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -683,7 +683,7 @@ static int count_dt(POSITION *y, POSITION *x, bool (*test)(FEAT_IDX feat), bool
683683 * @details
684684 * If requested, count only trapped chests.
685685 */
686-static int count_chests(POSITION *y, POSITION *x, bool trapped)
686+static int count_chests(player_type *creature_ptr, POSITION *y, POSITION *x, bool trapped)
687687 {
688688 DIRECTION d;
689689 int count;
@@ -697,8 +697,8 @@ static int count_chests(POSITION *y, POSITION *x, bool trapped)
697697 for (d = 0; d < 9; d++)
698698 {
699699 /* Extract adjacent (legal) location */
700- POSITION yy = p_ptr->y + ddy_ddd[d];
701- POSITION xx = p_ptr->x + ddx_ddd[d];
700+ POSITION yy = creature_ptr->y + ddy_ddd[d];
701+ POSITION xx = creature_ptr->x + ddx_ddd[d];
702702
703703 /* No (visible) chest is there */
704704 if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
@@ -846,7 +846,7 @@ void do_cmd_open(void)
846846 num_doors = count_dt(&y, &x, is_closed_door, FALSE);
847847
848848 /* Count chests (locked) */
849- num_chests = count_chests(&y, &x, FALSE);
849+ num_chests = count_chests(p_ptr, &y, &x, FALSE);
850850
851851 /* See if only one target */
852852 if (num_doors || num_chests)
@@ -1582,7 +1582,7 @@ void do_cmd_disarm(void)
15821582 num_traps = count_dt(&y, &x, is_trap, TRUE);
15831583
15841584 /* Count chests (trapped) */
1585- num_chests = count_chests(&y, &x, TRUE);
1585+ num_chests = count_chests(p_ptr, &y, &x, TRUE);
15861586
15871587 /* See if only one target */
15881588 if (num_traps || num_chests)
Show on old repository browser