• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision3a970452d7ad9d1e29b43ed86ade9eabcb799af0 (tree)
Time2019-05-19 16:00:25
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38844 start_time を world_type 構造体へ移動.

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -6029,7 +6029,7 @@ void do_cmd_edit_autopick(void)
60296029 old_autosave_turn = current_world_ptr->game_turn;
60306030 }
60316031
6032- /* HACK -- Reset start_time to stop counting current_world_ptr->play_time while edit */
6032+ /* HACK -- Reset current_world_ptr->start_time to stop counting current_world_ptr->play_time while edit */
60336033 update_playtime();
60346034
60356035 /* Free old entries */
@@ -6155,8 +6155,8 @@ void do_cmd_edit_autopick(void)
61556155 /* Reload autopick pref */
61566156 process_autopick_file(buf);
61576157
6158- /* HACK -- reset start_time so that current_world_ptr->play_time is not increase while edit */
6159- start_time = (u32b)time(NULL);
6158+ /* HACK -- reset current_world_ptr->start_time so that current_world_ptr->play_time is not increase while edit */
6159+ current_world_ptr->start_time = (u32b)time(NULL);
61606160
61616161 /* Save cursor location */
61626162 cx_save = tb->cx;
--- a/src/core.c
+++ b/src/core.c
@@ -5324,7 +5324,7 @@ void play_game(bool new_game)
53245324
53255325 p_ptr->is_dead = TRUE;
53265326
5327- start_time = (u32b)time(NULL);
5327+ current_world_ptr->start_time = (u32b)time(NULL);
53285328
53295329 /* No suspending now */
53305330 signals_ignore_tstp();
@@ -5472,7 +5472,7 @@ void play_game(bool new_game)
54725472 current_world_ptr->timewalk_m_idx = 0;
54735473 p_ptr->now_damaged = FALSE;
54745474 now_message = 0;
5475- start_time = time(NULL) - 1;
5475+ current_world_ptr->start_time = time(NULL) - 1;
54765476 record_o_name[0] = '\0';
54775477
54785478 /* Reset map panel */
--- a/src/externs.h
+++ b/src/externs.h
@@ -74,7 +74,6 @@ extern player_type *p_ptr;
7474 extern MONSTER_IDX pet_t_m_idx;
7575 extern MONSTER_IDX riding_t_m_idx;
7676 extern MONRACE_IDX today_mon;
77-extern u32b start_time;
7877 extern bool sukekaku;
7978 extern bool new_mane;
8079
--- a/src/variable.c
+++ b/src/variable.c
@@ -76,8 +76,6 @@ MONSTER_IDX riding_t_m_idx;
7676
7777 MONSTER_IDX today_mon;
7878
79-u32b start_time;
80-
8179 bool sukekaku;
8280 bool new_mane;
8381
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -3881,11 +3881,11 @@ void object_kind_track(KIND_OBJECT_IDX k_idx)
38813881 void update_playtime(void)
38823882 {
38833883 /* Check if the game has started */
3884- if (start_time != 0)
3884+ if (current_world_ptr->start_time != 0)
38853885 {
38863886 u32b tmp = (u32b)time(NULL);
3887- current_world_ptr->play_time += (tmp - start_time);
3888- start_time = tmp;
3887+ current_world_ptr->play_time += (tmp - current_world_ptr->start_time);
3888+ current_world_ptr->start_time = tmp;
38893889 }
38903890 }
38913891
--- a/src/world.h
+++ b/src/world.h
@@ -9,6 +9,7 @@ typedef struct {
99 GAME_TURN dungeon_turn; /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
1010 GAME_TURN dungeon_turn_limit; /*!< dungeon_turnの最大値 / Limit of game_turn in dungeon */
1111 GAME_TURN arena_start_turn; /*!< 闘技場賭博の開始ターン値 */
12+ u32b start_time;
1213
1314 MONSTER_IDX timewalk_m_idx; /*!< 現在時間停止を行っているモンスターのID */
1415
@@ -53,6 +54,7 @@ typedef struct {
5354
5455 bool creating_savefile; /* New savefile is currently created */
5556
57+
5658 } world_type;
5759
5860 extern bool is_daytime(void);
Show on old repository browser