• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionbb189040287fcb26088ea565bdb07a5163c91dd7 (tree)
Time2019-02-28 14:08:35
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38995 world_type 構造体に turn_limit を game_turn_limit に改名して取り込む。 / Rename turn_limit to game_turn_limit and move to world_type structure.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -1897,12 +1897,12 @@ static void init_turn(void)
18971897 {
18981898 /* Undead start just after midnight */
18991899 current_world_ptr->game_turn = (TURNS_PER_TICK*3 * TOWN_DAWN) / 4 + 1;
1900- turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
1900+ current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
19011901 }
19021902 else
19031903 {
19041904 current_world_ptr->game_turn = 1;
1905- turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
1905+ current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
19061906 }
19071907
19081908 dungeon_turn = 1;
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -6228,9 +6228,9 @@ void prevent_turn_overflow(void)
62286228 int rollback_days, i, j;
62296229 s32b rollback_turns;
62306230
6231- if (current_world_ptr->game_turn < turn_limit) return;
6231+ if (current_world_ptr->game_turn < current_world_ptr->game_turn_limit) return;
62326232
6233- rollback_days = 1 + (current_world_ptr->game_turn - turn_limit) / (TURNS_PER_TICK * TOWN_DAWN);
6233+ rollback_days = 1 + (current_world_ptr->game_turn - current_world_ptr->game_turn_limit) / (TURNS_PER_TICK * TOWN_DAWN);
62346234 rollback_turns = TURNS_PER_TICK * TOWN_DAWN * rollback_days;
62356235
62366236 if (current_world_ptr->game_turn > rollback_turns) current_world_ptr->game_turn -= rollback_turns;
--- a/src/externs.h
+++ b/src/externs.h
@@ -160,7 +160,6 @@ extern bool msg_flag;
160160 extern s16b running;
161161 extern GAME_TURN resting;
162162 extern bool invoking_midnight_curse;
163-extern GAME_TURN turn_limit;
164163 extern GAME_TURN dungeon_turn;
165164 extern GAME_TURN dungeon_turn_limit;
166165 extern GAME_TURN old_turn;
--- a/src/load.c
+++ b/src/load.c
@@ -2256,10 +2256,10 @@ static void rd_extra(void)
22562256 case RACE_SKELETON:
22572257 case RACE_ZOMBIE:
22582258 case RACE_SPECTRE:
2259- turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
2259+ current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
22602260 break;
22612261 default:
2262- turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
2262+ current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
22632263 break;
22642264 }
22652265 dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
--- a/src/types.h
+++ b/src/types.h
@@ -1901,5 +1901,7 @@ typedef struct {
19011901 */
19021902 POSITION max_wild_x;
19031903 POSITION max_wild_y;
1904- GAME_TURN game_turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
1904+ GAME_TURN game_turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
1905+ GAME_TURN game_turn_limit; /*!< game_turnの最大値 / Limit of game_turn */
1906+
19051907 } world_type;
--- a/src/variable.c
+++ b/src/variable.c
@@ -113,7 +113,6 @@ GAME_TURN resting; /* Current counter for resting, if any */
113113
114114 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
115115
116-GAME_TURN turn_limit; /*!< current_world_ptr->game_turnの最大値 / Limit of game current_world_ptr->game_turn */
117116 GAME_TURN dungeon_turn; /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
118117 GAME_TURN dungeon_turn_limit; /*!< dungeon_turnの最大値 / Limit of game current_world_ptr->game_turn in dungeon */
119118 GAME_TURN old_turn; /* Turn when level began */
Show on old repository browser