• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision423cb3beafe5ddbc41b9d0690866b3c15d13f655 (tree)
Time2019-05-11 13:26:37
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38844 ゲームシステム進行フラグを world_type 構造体へ移動.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -4456,7 +4456,7 @@ static bool player_birth_aux(void)
44564456 get_name();
44574457
44584458 /* Process the player name */
4459- process_player_name(creating_savefile);
4459+ process_player_name(current_world_ptr->creating_savefile);
44604460
44614461 /*** Edit character background ***/
44624462 edit_history();
--- a/src/bldg.c
+++ b/src/bldg.c
@@ -2636,7 +2636,7 @@ static PRICE compare_weapons(PRICE bcost)
26362636 concptr q, s;
26372637 TERM_LEN row = 2;
26382638 TERM_LEN wid = 38, mgn = 2;
2639- bool old_character_xtra = character_xtra;
2639+ bool old_character_xtra = current_world_ptr->character_xtra;
26402640 char ch;
26412641 PRICE total = 0;
26422642 PRICE cost = 0; /* First time no price */
@@ -2672,7 +2672,7 @@ static PRICE compare_weapons(PRICE bcost)
26722672 item_tester_hook = item_tester_hook_orthodox_melee_weapons;
26732673
26742674 /* Hack -- prevent "icky" message */
2675- character_xtra = TRUE;
2675+ current_world_ptr->character_xtra = TRUE;
26762676
26772677 /* Diaplay selected weapon's infomation */
26782678 for (i = 0; i < n; i++)
@@ -2697,7 +2697,7 @@ static PRICE compare_weapons(PRICE bcost)
26972697 p_ptr->update |= PU_BONUS;
26982698 handle_stuff();
26992699
2700- character_xtra = old_character_xtra;
2700+ current_world_ptr->character_xtra = old_character_xtra;
27012701
27022702 #ifdef JP
27032703 put_str(format("[ 比較対象: 's'で変更 ($%d) ]", cost), 1, (wid + mgn));
@@ -4147,7 +4147,7 @@ void do_cmd_bldg(void)
41474147 forget_view();
41484148
41494149 /* Hack -- Increase "icky" depth */
4150- character_icky++;
4150+ current_world_ptr->character_icky++;
41514151
41524152 command_arg = 0;
41534153 command_rep = 0;
@@ -4204,7 +4204,7 @@ void do_cmd_bldg(void)
42044204 }
42054205
42064206 /* Hack -- Decrease "icky" depth */
4207- character_icky--;
4207+ current_world_ptr->character_icky--;
42084208
42094209 Term_clear();
42104210
--- a/src/cmd-dump.c
+++ b/src/cmd-dump.c
@@ -1638,7 +1638,7 @@ void do_cmd_options_aux(int page, concptr info)
16381638 int i, k = 0, n = 0, l;
16391639 int opt[24];
16401640 char buf[80];
1641- bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
1641+ bool browse_only = (page == OPT_PAGE_BIRTH) && current_world_ptr->character_generated &&
16421642 (!p_ptr->wizard || !allow_debug_opts);
16431643
16441644
--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -18,6 +18,7 @@
1818 #include "cmd-basic.h"
1919 #include "view-mainwindow.h"
2020 #include "targeting.h"
21+#include "world.h"
2122
2223 /*!
2324 * @brief プレイヤーの騎乗/下馬処理判定
@@ -28,14 +29,14 @@
2829 bool player_can_ride_aux(grid_type *g_ptr, bool now_riding)
2930 {
3031 bool p_can_enter;
31- bool old_character_xtra = character_xtra;
32+ bool old_character_xtra = current_world_ptr->character_xtra;
3233 MONSTER_IDX old_riding = p_ptr->riding;
3334 bool old_riding_ryoute = p_ptr->riding_ryoute;
3435 bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
3536 bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
3637
3738 /* Hack -- prevent "icky" message */
38- character_xtra = TRUE;
39+ current_world_ptr->character_xtra = TRUE;
3940
4041 if (now_riding) p_ptr->riding = g_ptr->m_idx;
4142 else
@@ -59,7 +60,7 @@ bool player_can_ride_aux(grid_type *g_ptr, bool now_riding)
5960 p_ptr->update |= PU_BONUS;
6061 handle_stuff();
6162
62- character_xtra = old_character_xtra;
63+ current_world_ptr->character_xtra = old_character_xtra;
6364
6465 return p_can_enter;
6566 }
--- a/src/core.c
+++ b/src/core.c
@@ -4985,7 +4985,7 @@ static void dungeon(bool load_game)
49854985
49864986
49874987 /* Enter "xtra" mode */
4988- character_xtra = TRUE;
4988+ current_world_ptr->character_xtra = TRUE;
49894989
49904990 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
49914991 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
@@ -4994,7 +4994,7 @@ static void dungeon(bool load_game)
49944994 handle_stuff();
49954995
49964996 /* Leave "xtra" mode */
4997- character_xtra = FALSE;
4997+ current_world_ptr->character_xtra = FALSE;
49984998
49994999 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
50005000 p_ptr->update |= (PU_COMBINE | PU_REORDER);
@@ -5270,7 +5270,7 @@ void play_game(bool new_game)
52705270 p_ptr->hack_mutation = FALSE;
52715271
52725272 /* Hack -- Character is "icky" */
5273- character_icky = TRUE;
5273+ current_world_ptr->character_icky = TRUE;
52745274
52755275 /* Make sure main term is active */
52765276 Term_activate(angband_term[0]);
@@ -5321,7 +5321,7 @@ void play_game(bool new_game)
53215321 signals_ignore_tstp();
53225322
53235323 /* Hack -- Character is now "icky" */
5324- character_icky = TRUE;
5324+ current_world_ptr->character_icky = TRUE;
53255325
53265326 /* Build the filename */
53275327 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
@@ -5358,16 +5358,16 @@ void play_game(bool new_game)
53585358 quit(0);
53595359 }
53605360
5361- creating_savefile = new_game;
5361+ current_world_ptr->creating_savefile = new_game;
53625362
53635363 /* Nothing loaded */
5364- if (!character_loaded)
5364+ if (!current_world_ptr->character_loaded)
53655365 {
53665366 /* Make new player */
53675367 new_game = TRUE;
53685368
53695369 /* The dungeon is not ready */
5370- character_dungeon = FALSE;
5370+ current_world_ptr->character_dungeon = FALSE;
53715371
53725372 /* Prepare to init the RNG */
53735373 init_random_seed = TRUE;
@@ -5400,7 +5400,7 @@ void play_game(bool new_game)
54005400 if (new_game)
54015401 {
54025402 /* The dungeon is not ready */
5403- character_dungeon = FALSE;
5403+ current_world_ptr->character_dungeon = FALSE;
54045404
54055405 /* Start in town */
54065406 current_floor_ptr->dun_level = 0;
@@ -5456,7 +5456,7 @@ void play_game(bool new_game)
54565456 }
54575457 }
54585458
5459- creating_savefile = FALSE;
5459+ current_world_ptr->creating_savefile = FALSE;
54605460
54615461 p_ptr->teleport_town = FALSE;
54625462 p_ptr->sutemi = FALSE;
@@ -5529,7 +5529,7 @@ void play_game(bool new_game)
55295529
55305530
55315531 /* Generate a dungeon level if needed */
5532- if (!character_dungeon)
5532+ if (!current_world_ptr->character_dungeon)
55335533 {
55345534 change_floor();
55355535 }
@@ -5555,11 +5555,11 @@ void play_game(bool new_game)
55555555 }
55565556
55575557 /* Character is now "complete" */
5558- character_generated = TRUE;
5558+ current_world_ptr->character_generated = TRUE;
55595559
55605560
55615561 /* Hack -- Character is no longer "icky" */
5562- character_icky = FALSE;
5562+ current_world_ptr->character_icky = FALSE;
55635563
55645564
55655565 if (new_game)
@@ -5629,11 +5629,11 @@ void play_game(bool new_game)
56295629 dungeon(load_game);
56305630
56315631 /* Hack -- prevent "icky" message */
5632- character_xtra = TRUE;
5632+ current_world_ptr->character_xtra = TRUE;
56335633
56345634 handle_stuff();
56355635
5636- character_xtra = FALSE;
5636+ current_world_ptr->character_xtra = FALSE;
56375637
56385638 /* Cancel the target */
56395639 target_who = 0;
@@ -5797,7 +5797,7 @@ void close_game(void)
57975797
57985798
57995799 /* Hack -- Character is now "icky" */
5800- character_icky = TRUE;
5800+ current_world_ptr->character_icky = TRUE;
58015801
58025802
58035803 /* Build the filename */
--- a/src/externs.h
+++ b/src/externs.h
@@ -51,13 +51,6 @@ extern const byte feature_action_flags[FF_FLAG_MAX];
5151
5252 /* variable.c */
5353
54-extern bool character_generated;
55-extern bool character_dungeon;
56-extern bool character_loaded;
57-extern bool character_saved;
58-extern bool character_icky;
59-extern bool character_xtra;
60-extern bool creating_savefile;
6154 extern COMMAND_CODE command_cmd;
6255 extern COMMAND_ARG command_arg;
6356 extern s16b command_rep;
--- a/src/files.c
+++ b/src/files.c
@@ -630,7 +630,7 @@ errr process_pref_file_command(char *buf)
630630 int os = option_info[i].o_set;
631631 int ob = option_info[i].o_bit;
632632
633- if ((p_ptr->playing || character_xtra) &&
633+ if ((p_ptr->playing || current_world_ptr->character_xtra) &&
634634 (OPT_PAGE_BIRTH == option_info[i].o_page) && !p_ptr->wizard)
635635 {
636636 msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not changed! '%s'"), buf);
@@ -4001,7 +4001,7 @@ void display_player(int mode)
40014001 #endif
40024002 }
40034003 }
4004- else if (character_dungeon)
4004+ else if (current_world_ptr->character_dungeon)
40054005 {
40064006 if (!current_floor_ptr->dun_level)
40074007 {
@@ -5809,7 +5809,7 @@ void process_player_name(bool sf)
58095809 int i, k = 0;
58105810 char old_player_base[32] = "";
58115811
5812- if (character_generated) strcpy(old_player_base, player_base);
5812+ if (current_world_ptr->character_generated) strcpy(old_player_base, player_base);
58135813
58145814 /* Cannot be too long */
58155815 #if defined(MACINTOSH) || defined(ACORN)
@@ -5946,7 +5946,7 @@ void process_player_name(bool sf)
59465946 }
59475947
59485948 /* Load an autopick preference file */
5949- if (character_generated)
5949+ if (current_world_ptr->character_generated)
59505950 {
59515951 if (!streq(old_player_base, player_base)) autopick_load_pref(FALSE);
59525952 }
@@ -6622,7 +6622,7 @@ bool check_score(void)
66226622 void exit_game_panic(void)
66236623 {
66246624 /* If nothing important has happened, just quit */
6625- if (!character_generated || character_saved) quit(_("緊急事態", "panic"));
6625+ if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(_("緊急事態", "panic"));
66266626
66276627 /* Mega-Hack -- see "msg_print()" */
66286628 msg_flag = FALSE;
@@ -6821,17 +6821,17 @@ errr process_histpref_file(concptr name)
68216821 {
68226822 char buf[1024];
68236823 errr err = 0;
6824- bool old_character_xtra = character_xtra;
6824+ bool old_character_xtra = current_world_ptr->character_xtra;
68256825
68266826 /* Build the filename */
68276827 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
68286828
68296829 /* Hack -- prevent modification birth options in this file */
6830- character_xtra = TRUE;
6830+ current_world_ptr->character_xtra = TRUE;
68316831
68326832 err = process_pref_file_aux(buf, PREF_TYPE_HISTPREF);
68336833
6834- character_xtra = old_character_xtra;
6834+ current_world_ptr->character_xtra = old_character_xtra;
68356835 return (err);
68366836 }
68376837
@@ -7042,7 +7042,7 @@ static void handle_signal_simple(int sig)
70427042
70437043
70447044 /* Nothing to save, just quit */
7045- if (!character_generated || character_saved) quit(NULL);
7045+ if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
70467046
70477047
70487048 /* Count the signals */
@@ -7145,7 +7145,7 @@ static void handle_signal_abort(int sig)
71457145
71467146
71477147 /* Nothing to save, just quit */
7148- if (!character_generated || character_saved) quit(NULL);
7148+ if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
71497149
71507150
71517151 forget_lite();
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -1083,7 +1083,7 @@ void change_floor(void)
10831083 bool loaded = FALSE;
10841084
10851085 /* The dungeon is not ready */
1086- character_dungeon = FALSE;
1086+ current_world_ptr->character_dungeon = FALSE;
10871087
10881088 /* No longer in the trap detecteded region */
10891089 p_ptr->dtrap = FALSE;
@@ -1375,7 +1375,7 @@ void change_floor(void)
13751375 p_ptr->floor_id = new_floor_id;
13761376
13771377 /* The dungeon is ready */
1378- character_dungeon = TRUE;
1378+ current_world_ptr->character_dungeon = TRUE;
13791379
13801380 /* Hack -- Munchkin characters always get whole map */
13811381 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
--- a/src/floor.h
+++ b/src/floor.h
@@ -230,7 +230,7 @@ typedef struct {
230230 */
231231 #define cave_empty_bold2(Y,X) \
232232 (cave_empty_bold(Y,X) && \
233- (character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
233+ (current_world_ptr->character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
234234
235235
236236 /*
--- a/src/grid.c
+++ b/src/grid.c
@@ -1737,7 +1737,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
17371737 feature_type *f_ptr = &f_info[feat];
17381738 bool old_los, old_mirror;
17391739
1740- if (!character_dungeon)
1740+ if (!current_world_ptr->character_dungeon)
17411741 {
17421742 /* Clear mimic type */
17431743 g_ptr->mimic = 0;
@@ -1929,7 +1929,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
19291929 found = TRUE;
19301930 }
19311931
1932- if (found && character_dungeon && player_can_see_bold(y, x))
1932+ if (found && current_world_ptr->character_dungeon && player_can_see_bold(y, x))
19331933 {
19341934 msg_print(_("何かを発見した!", "You have found something!"));
19351935 }
@@ -1939,7 +1939,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
19391939 {
19401940 feature_type *old_f_ptr = &f_info[oldfeat];
19411941
1942- if (have_flag(old_f_ptr->flags, FF_GLASS) && character_dungeon)
1942+ if (have_flag(old_f_ptr->flags, FF_GLASS) && current_world_ptr->character_dungeon)
19431943 {
19441944 project(PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(current_floor_ptr->dun_level, 100) / 4, GF_SHARDS,
19451945 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
--- a/src/load.c
+++ b/src/load.c
@@ -2968,9 +2968,9 @@ static errr rd_dungeon_old(void)
29682968
29692969 /* The dungeon is ready */
29702970 if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena)
2971- character_dungeon = FALSE;
2971+ current_world_ptr->character_dungeon = FALSE;
29722972 else
2973- character_dungeon = TRUE;
2973+ current_world_ptr->character_dungeon = TRUE;
29742974
29752975 /* Success */
29762976 return (0);
@@ -3416,7 +3416,7 @@ static errr rd_dungeon(void)
34163416 }
34173417
34183418 /* The dungeon is ready */
3419- character_dungeon = TRUE;
3419+ current_world_ptr->character_dungeon = TRUE;
34203420
34213421 /* Success or Error */
34223422 return err;
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -111,6 +111,7 @@
111111 #include "quest.h"
112112 #include "files.h"
113113 #include "core.h"
114+#include "world.h"
114115
115116 #ifdef WINDOWS
116117 #include <windows.h>
@@ -3497,7 +3498,7 @@ static void setup_menus(void)
34973498
34983499
34993500 /* No character available */
3500- if (!character_generated)
3501+ if (!current_world_ptr->character_generated)
35013502 {
35023503 /* Menu "File", Item "New" */
35033504 EnableMenuItem(hm, IDM_FILE_NEW, MF_BYCOMMAND | MF_ENABLED);
@@ -3507,7 +3508,7 @@ static void setup_menus(void)
35073508 }
35083509
35093510 /* A character available */
3510- if (character_generated)
3511+ if (current_world_ptr->character_generated)
35113512 {
35123513 /* Menu "File", Item "Save" */
35133514 EnableMenuItem(hm, IDM_FILE_SAVE,
@@ -3811,7 +3812,7 @@ static void process_menus(WORD wCmd)
38113812 /* Save game */
38123813 case IDM_FILE_SAVE:
38133814 {
3814- if (game_in_progress && character_generated)
3815+ if (game_in_progress && current_world_ptr->character_generated)
38153816 {
38163817 if (!can_save)
38173818 {
@@ -3839,7 +3840,7 @@ static void process_menus(WORD wCmd)
38393840 /* Exit */
38403841 case IDM_FILE_EXIT:
38413842 {
3842- if (game_in_progress && character_generated)
3843+ if (game_in_progress && current_world_ptr->character_generated)
38433844 {
38443845 if (!can_save)
38453846 {
@@ -4785,7 +4786,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
47854786
47864787 case WM_CLOSE:
47874788 {
4788- if (game_in_progress && character_generated)
4789+ if (game_in_progress && current_world_ptr->character_generated)
47894790 {
47904791 if (!can_save)
47914792 {
@@ -4815,7 +4816,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
48154816
48164817 case WM_QUERYENDSESSION:
48174818 {
4818- if (game_in_progress && character_generated)
4819+ if (game_in_progress && current_world_ptr->character_generated)
48194820 {
48204821 /* Hack -- Forget messages */
48214822 msg_flag = FALSE;
--- a/src/monster1.c
+++ b/src/monster1.c
@@ -2805,7 +2805,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
28052805 a_ptr->cur_num = 1;
28062806
28072807 /* Hack -- Memorize location of artifact in saved floors */
2808- if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
2808+ if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
28092809 }
28102810 else if (!preserve_mode) a_ptr->cur_num = 1;
28112811 }
@@ -2977,7 +2977,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
29772977 a_ptr->cur_num = 1;
29782978
29792979 /* Hack -- Memorize location of artifact in saved floors */
2980- if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
2980+ if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
29812981 }
29822982 else if (!preserve_mode) a_ptr->cur_num = 1;
29832983 }
@@ -3000,7 +3000,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
30003000 a_ptr->cur_num = 1;
30013001
30023002 /* Hack -- Memorize location of artifact in saved floors */
3003- if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
3003+ if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
30043004 }
30053005 else if (!preserve_mode) a_ptr->cur_num = 1;
30063006
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -480,7 +480,7 @@ MONSTER_IDX m_pop(void)
480480 }
481481
482482 /* Warn the player (except during dungeon creation) */
483- if (character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
483+ if (current_world_ptr->character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
484484
485485 /* Try not to crash */
486486 return (0);
@@ -2790,14 +2790,14 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
27902790 * Memorize location of the unique monster in saved floors.
27912791 * A unique monster move from old saved floor.
27922792 */
2793- if (character_dungeon &&
2793+ if (current_world_ptr->character_dungeon &&
27942794 ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)))
27952795 real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
27962796
27972797 /* Hack -- Count the number of "reproducers" */
27982798 if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
27992799
2800- if (p_ptr->warning && character_dungeon)
2800+ if (p_ptr->warning && current_world_ptr->character_dungeon)
28012801 {
28022802 if (r_ptr->flags1 & RF1_UNIQUE)
28032803 {
--- a/src/object2.c
+++ b/src/object2.c
@@ -13,6 +13,7 @@
1313
1414 #include "angband.h"
1515 #include "util.h"
16+#include "world.h"
1617
1718 #include "object.h"
1819
@@ -429,7 +430,7 @@ void wipe_o_list(void)
429430 if (!o_ptr->k_idx) continue;
430431
431432 /* Mega-Hack -- preserve artifacts */
432- if (!character_dungeon || preserve_mode)
433+ if (!current_world_ptr->character_dungeon || preserve_mode)
433434 {
434435 /* Hack -- Preserve unknown artifacts */
435436 if (object_is_fixed_artifact(o_ptr) && !object_is_known(o_ptr))
@@ -521,7 +522,7 @@ OBJECT_IDX o_pop(void)
521522
522523
523524 /* Warn the player (except during dungeon creation) */
524- if (character_dungeon) msg_print(_("アイテムが多すぎる!", "Too many objects!"));
525+ if (current_world_ptr->character_dungeon) msg_print(_("アイテムが多すぎる!", "Too many objects!"));
525526
526527 return (0);
527528 }
@@ -3999,7 +4000,7 @@ void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
39994000 a_ptr->cur_num = 1;
40004001
40014002 /* Hack -- Memorize location of artifact in saved floors */
4002- if (character_dungeon)
4003+ if (current_world_ptr->character_dungeon)
40034004 a_ptr->floor_id = p_ptr->floor_id;
40044005
40054006 /* Extract the other fields */
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -2767,7 +2767,7 @@ void calc_bonuses(void)
27672767
27682768
27692769 /* Hack -- handle "xtra" mode */
2770- if (character_xtra) return;
2770+ if (current_world_ptr->character_xtra) return;
27712771
27722772 /* Take note when "heavy bow" changes */
27732773 if (p_ptr->old_heavy_shoot != p_ptr->heavy_shoot)
@@ -3227,10 +3227,10 @@ static void calc_spells(void)
32273227 if (!mp_ptr->spell_book) return;
32283228
32293229 /* Hack -- wait for creation */
3230- if (!character_generated) return;
3230+ if (!current_world_ptr->character_generated) return;
32313231
32323232 /* Hack -- handle "xtra" mode */
3233- if (character_xtra) return;
3233+ if (current_world_ptr->character_xtra) return;
32343234
32353235 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
32363236 {
@@ -3826,7 +3826,7 @@ static void calc_mana(void)
38263826
38273827
38283828 /* Hack -- handle "xtra" mode */
3829- if (character_xtra) return;
3829+ if (current_world_ptr->character_xtra) return;
38303830
38313831 /* Take note when "glove state" changes */
38323832 if (p_ptr->old_cumber_glove != p_ptr->cumber_glove)
@@ -4072,10 +4072,10 @@ void update_creature(player_type *creature_ptr)
40724072 }
40734073
40744074 /* Character is not ready yet, no screen updates */
4075- if (!character_generated) return;
4075+ if (!current_world_ptr->character_generated) return;
40764076
40774077 /* Character is in "icky" mode, no screen updates */
4078- if (character_icky) return;
4078+ if (current_world_ptr->character_icky) return;
40794079
40804080 if (creature_ptr->update & (PU_UN_LITE))
40814081 {
@@ -4241,7 +4241,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
42414241 {
42424242 int power = 100;
42434243
4244- if (p_ptr->inside_battle || !character_dungeon) return;
4244+ if (p_ptr->inside_battle || !current_world_ptr->character_dungeon) return;
42454245
42464246 if (!necro && m_ptr)
42474247 {
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -1,6 +1,7 @@
11 #include "angband.h"
22 #include "util.h"
33
4+#include "world.h"
45 #include "cmd-spell.h"
56 #include "floor.h"
67 #include "spells.h"
--- a/src/save.c
+++ b/src/save.c
@@ -1576,7 +1576,7 @@ static bool save_player_aux(char *name)
15761576 counts_write(0, current_world_ptr->play_time);
15771577
15781578 /* Successful save */
1579- character_saved = TRUE;
1579+ current_world_ptr->character_saved = TRUE;
15801580
15811581 /* Success */
15821582 return (TRUE);
@@ -1651,7 +1651,7 @@ bool save_player(void)
16511651 safe_setuid_drop();
16521652
16531653 /* Hack -- Pretend the character was loaded */
1654- character_loaded = TRUE;
1654+ current_world_ptr->character_loaded = TRUE;
16551655
16561656 #ifdef VERIFY_SAVEFILE
16571657
@@ -1712,7 +1712,7 @@ bool save_player(void)
17121712 * allowed to save his game when he quits.
17131713 *
17141714 * We return "TRUE" if the savefile was usable, and we set the global
1715- * flag "character_loaded" if a real, living, character was loaded.
1715+ * flag "current_world_ptr->character_loaded" if a real, living, character was loaded.
17161716 *
17171717 * Note that we always try to load the "current" savefile, even if
17181718 * there is no such file, so we must check for "empty" savefile names.
@@ -1897,7 +1897,7 @@ bool load_player(void)
18971897 if (arg_wizard)
18981898 {
18991899 /* A character was loaded */
1900- character_loaded = TRUE;
1900+ current_world_ptr->character_loaded = TRUE;
19011901 return (TRUE);
19021902 }
19031903
@@ -1911,7 +1911,7 @@ bool load_player(void)
19111911 }
19121912
19131913 /* A character was loaded */
1914- character_loaded = TRUE;
1914+ current_world_ptr->character_loaded = TRUE;
19151915
19161916 {
19171917 u32b tmp = counts_read(2);
--- a/src/store.c
+++ b/src/store.c
@@ -5761,7 +5761,7 @@ void do_cmd_store(void)
57615761 forget_view();
57625762
57635763 /* Hack -- Character is in "icky" mode */
5764- character_icky = TRUE;
5764+ current_world_ptr->character_icky = TRUE;
57655765
57665766 /* command reset */
57675767 command_arg = 0;
@@ -5861,7 +5861,7 @@ void do_cmd_store(void)
58615861 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
58625862
58635863 /* Hack -- Character is still in "icky" mode */
5864- character_icky = TRUE;
5864+ current_world_ptr->character_icky = TRUE;
58655865
58665866 handle_stuff();
58675867
@@ -5945,7 +5945,7 @@ void do_cmd_store(void)
59455945 take_turn(p_ptr, 100);
59465946
59475947 /* Hack -- Character is no longer in "icky" mode */
5948- character_icky = FALSE;
5948+ current_world_ptr->character_icky = FALSE;
59495949
59505950 /* Hack -- Cancel automatic command */
59515951 command_new = 0;
--- a/src/util.c
+++ b/src/util.c
@@ -2089,7 +2089,7 @@ char (*inkey_hack)(int flush_first) = NULL;
20892089 * is only requested (via "Term_inkey()") when "angband_term[0]" is active.
20902090 *
20912091 * Mega-Hack -- This function is used as the entry point for clearing the
2092- * "signal_count" variable, and of the "character_saved" variable.
2092+ * "signal_count" variable, and of the "current_world_ptr->character_saved" variable.
20932093 *
20942094 * Hack -- Note the use of "inkey_next" to allow "keymaps" to be processed.
20952095 *
@@ -2154,7 +2154,7 @@ char inkey(void)
21542154 (void)Term_get_cursor(&v);
21552155
21562156 /* Show the cursor if waiting, except sometimes in "command" mode */
2157- if (!inkey_scan && (!inkey_flag || hilite_player || character_icky))
2157+ if (!inkey_scan && (!inkey_flag || hilite_player || current_world_ptr->character_icky))
21582158 {
21592159 /* Show the cursor */
21602160 (void)Term_set_cursor(1);
@@ -2189,7 +2189,7 @@ char inkey(void)
21892189 Term_activate(angband_term[0]);
21902190
21912191 /* Mega-Hack -- reset saved flag */
2192- character_saved = FALSE;
2192+ current_world_ptr->character_saved = FALSE;
21932193
21942194 /* Mega-Hack -- reset signal counter */
21952195 signal_count = 0;
@@ -2877,7 +2877,7 @@ void msg_print(concptr msg)
28772877 n = strlen(buf);
28782878
28792879 /* Memorize the message */
2880- if (character_generated) message_add(buf);
2880+ if (current_world_ptr->character_generated) message_add(buf);
28812881
28822882 /* Analyze the buffer */
28832883 t = buf;
@@ -2941,7 +2941,7 @@ void msg_print(concptr msg)
29412941 msg_flush(split + 1);
29422942
29432943 /* Memorize the piece */
2944- /* if (character_generated) message_add(t); */
2944+ /* if (current_world_ptr->character_generated) message_add(t); */
29452945
29462946 /* Restore the split character */
29472947 t[split] = oops;
@@ -2957,7 +2957,7 @@ void msg_print(concptr msg)
29572957 Term_putstr(p, 0, n, TERM_WHITE, t);
29582958
29592959 /* Memorize the tail */
2960- /* if (character_generated) message_add(t); */
2960+ /* if (current_world_ptr->character_generated) message_add(t); */
29612961
29622962 p_ptr->window |= (PW_MESSAGE);
29632963 update_output();
@@ -3015,7 +3015,7 @@ void screen_save(void)
30153015 if (screen_depth++ == 0) Term_save();
30163016
30173017 /* Increase "icky" depth */
3018- character_icky++;
3018+ current_world_ptr->character_icky++;
30193019 }
30203020
30213021
@@ -3033,7 +3033,7 @@ void screen_load(void)
30333033 if (--screen_depth == 0) Term_load();
30343034
30353035 /* Decrease "icky" depth */
3036- character_icky--;
3036+ current_world_ptr->character_icky--;
30373037 }
30383038
30393039
--- a/src/variable.c
+++ b/src/variable.c
@@ -15,18 +15,6 @@
1515
1616 int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
1717
18-/*
19- * Various things
20- */
21-bool character_generated; /* The character exists */
22-bool character_dungeon; /* The character has a dungeon */
23-bool character_loaded; /* The character was loaded from a savefile */
24-bool character_saved; /* The character was just saved to a savefile */
25-
26-bool character_icky; /* The game is in an icky full screen mode */
27-bool character_xtra; /* The game is in an icky startup mode */
28-
29-bool creating_savefile; /* New savefile is currently created */
3018
3119 s16b command_cmd; /* Current "Angband Command" */
3220
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -2067,10 +2067,10 @@ static void redraw_stuff(void)
20672067 if (!p_ptr->redraw) return;
20682068
20692069 /* Character is not ready yet, no screen updates */
2070- if (!character_generated) return;
2070+ if (!current_world_ptr->character_generated) return;
20712071
20722072 /* Character is in "icky" mode, no screen updates */
2073- if (character_icky) return;
2073+ if (current_world_ptr->character_icky) return;
20742074
20752075 /* Hack -- clear the screen */
20762076 if (p_ptr->redraw & (PR_WIPE))
@@ -2382,7 +2382,7 @@ void update_playtime(void)
23822382 void resize_map(void)
23832383 {
23842384 /* Only if the dungeon exists */
2385- if (!character_dungeon) return;
2385+ if (!current_world_ptr->character_dungeon) return;
23862386
23872387 /* Mega-Hack -- no panel yet */
23882388 panel_row_max = 0;
@@ -2420,7 +2420,7 @@ void resize_map(void)
24202420 void redraw_window(void)
24212421 {
24222422 /* Only if the dungeon exists */
2423- if (!character_dungeon) return;
2423+ if (!current_world_ptr->character_dungeon) return;
24242424
24252425 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
24262426 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
--- a/src/world.h
+++ b/src/world.h
@@ -40,6 +40,16 @@ typedef struct {
4040 u16b sf_lives; /* Number of past "lives" with this file */
4141 u16b sf_saves; /* Number of "saves" during this life */
4242
43+ bool character_generated; /* The character exists */
44+ bool character_dungeon; /* The character has a dungeon */
45+ bool character_loaded; /* The character was loaded from a savefile */
46+ bool character_saved; /* The character was just saved to a savefile */
47+
48+ bool character_icky; /* The game is in an icky full screen mode */
49+ bool character_xtra; /* The game is in an icky startup mode */
50+
51+ bool creating_savefile; /* New savefile is currently created */
52+
4353 } world_type;
4454
4555 extern bool is_daytime(void);
Show on old repository browser