• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision00c68daf8a92d232514573dff640034791e49d55 (tree)
Time2019-05-15 23:59:35
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38995 running を player_type へ移動.

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -2128,7 +2128,7 @@ void do_cmd_run(void)
21282128 if (get_rep_dir(&dir,FALSE))
21292129 {
21302130 /* Hack -- Set the run counter */
2131- running = (command_arg ? command_arg : 1000);
2131+ p_ptr->running = (command_arg ? command_arg : 1000);
21322132
21332133 /* First step */
21342134 run_step(dir);
--- a/src/core.c
+++ b/src/core.c
@@ -4506,7 +4506,7 @@ static void process_player(void)
45064506 if (check_abort)
45074507 {
45084508 /* Check for "player abort" (semi-efficiently for resting) */
4509- if (running || travel.run || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
4509+ if (p_ptr->running || travel.run || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
45104510 {
45114511 /* Do not wait */
45124512 inkey_scan = TRUE;
@@ -4697,7 +4697,7 @@ static void process_player(void)
46974697 }
46984698
46994699 /* Running */
4700- else if (running)
4700+ else if (p_ptr->running)
47014701 {
47024702 /* Take a step */
47034703 run_step(0);
--- a/src/externs.h
+++ b/src/externs.h
@@ -54,7 +54,6 @@ extern TERM_LEN command_gap;
5454 extern s16b command_wrk;
5555 extern s16b command_new;
5656 extern bool msg_flag;
57-extern s16b running;
5857
5958 extern s16b signal_count;
6059
--- a/src/grid.c
+++ b/src/grid.c
@@ -1687,7 +1687,7 @@ void update_flow(void)
16871687 if (tmp_pos.n) return;
16881688
16891689 /* The last way-point is on the map */
1690- if (running && in_bounds(flow_y, flow_x))
1690+ if (p_ptr->running && in_bounds(flow_y, flow_x))
16911691 {
16921692 /* The way point is in sight - do not update. (Speedup) */
16931693 if (current_floor_ptr->grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -1137,7 +1137,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11371137 {
11381138 msg_format(_("空を飛ばないと%sの上には行けない。", "You need to fly to go through the %s."), f_name + f_info[get_feat_mimic(g_ptr)].name);
11391139 free_turn(p_ptr);
1140- running = 0;
1140+ p_ptr->running = 0;
11411141 oktomove = FALSE;
11421142 }
11431143
@@ -1888,7 +1888,7 @@ void run_step(DIRECTION dir)
18881888 }
18891889
18901890 /* Decrease the run counter */
1891- if (--running <= 0) return;
1891+ if (--p_ptr->running <= 0) return;
18921892
18931893 /* Take time */
18941894 take_turn(p_ptr, 100);
@@ -2316,10 +2316,10 @@ void disturb(bool stop_search, bool stop_travel)
23162316 }
23172317
23182318 /* Cancel running */
2319- if (running)
2319+ if (p_ptr->running)
23202320 {
23212321 /* Cancel */
2322- running = 0;
2322+ p_ptr->running = 0;
23232323
23242324 /* Check for new panel if appropriate */
23252325 if (center_player && !center_running) verify_panel();
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -462,6 +462,8 @@ struct player_type
462462
463463 /*** Extracted fields ***/
464464
465+ s16b running; /* Current counter for running, if any */
466+
465467 WEIGHT total_weight; /*!< 所持品と装備品の計算総重量 / Total weight being carried */
466468
467469 s16b stat_add[A_MAX]; /* Modifiers to stat values */
--- a/src/targeting.c
+++ b/src/targeting.c
@@ -114,7 +114,7 @@ void verify_panel(void)
114114 if (max_pcol_min < 0) max_pcol_min = 0;
115115
116116 /* Center on player */
117- if (center_player && (center_running || !running))
117+ if (center_player && (center_running || !p_ptr->running))
118118 {
119119 /* Center vertically */
120120 prow_min = y - hgt / 2;
--- a/src/variable.c
+++ b/src/variable.c
@@ -28,8 +28,6 @@ s16b command_new; /* Command chaining from inven/equip view */
2828
2929 bool msg_flag; /* Used in msg_print() for "buffering" */
3030
31-s16b running; /* Current counter for running, if any */
32-
3331 s16b signal_count; /* Hack -- Count interupts */
3432
3533 bool get_com_no_macros = FALSE; /* Expand macros in "get_com" or not */
Show on old repository browser