OSDN Git Service

[Refactor] #38844 ゲームシステム進行フラグを world_type 構造体へ移動.
authordeskull <deskull@users.sourceforge.jp>
Sat, 11 May 2019 04:26:37 +0000 (13:26 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 11 May 2019 04:26:37 +0000 (13:26 +0900)
23 files changed:
src/birth.c
src/bldg.c
src/cmd-dump.c
src/cmd-pet.c
src/core.c
src/externs.h
src/files.c
src/floor-save.c
src/floor.h
src/grid.c
src/load.c
src/main-win.c
src/monster1.c
src/monster2.c
src/object2.c
src/player-status.c
src/realm-crusade.c
src/save.c
src/store.c
src/util.c
src/variable.c
src/view-mainwindow.c
src/world.h

index 0ebc39c..b3789c7 100644 (file)
@@ -4456,7 +4456,7 @@ static bool player_birth_aux(void)
        get_name();
 
        /* Process the player name */
-       process_player_name(creating_savefile);
+       process_player_name(current_world_ptr->creating_savefile);
 
        /*** Edit character background ***/
        edit_history();
index 06716d8..ec813d1 100644 (file)
@@ -2636,7 +2636,7 @@ static PRICE compare_weapons(PRICE bcost)
        concptr q, s;
        TERM_LEN row = 2;
        TERM_LEN wid = 38, mgn = 2;
-       bool old_character_xtra = character_xtra;
+       bool old_character_xtra = current_world_ptr->character_xtra;
        char ch;
        PRICE total = 0;
        PRICE cost = 0; /* First time no price */
@@ -2672,7 +2672,7 @@ static PRICE compare_weapons(PRICE bcost)
                item_tester_hook = item_tester_hook_orthodox_melee_weapons;
 
                /* Hack -- prevent "icky" message */
-               character_xtra = TRUE;
+               current_world_ptr->character_xtra = TRUE;
 
                /* Diaplay selected weapon's infomation */
                for (i = 0; i < n; i++)
@@ -2697,7 +2697,7 @@ static PRICE compare_weapons(PRICE bcost)
                p_ptr->update |= PU_BONUS;
                handle_stuff();
 
-               character_xtra = old_character_xtra;
+               current_world_ptr->character_xtra = old_character_xtra;
 
 #ifdef JP
                put_str(format("[ 比較対象: 's'で変更 ($%d) ]", cost), 1, (wid + mgn));
@@ -4147,7 +4147,7 @@ void do_cmd_bldg(void)
        forget_view();
 
        /* Hack -- Increase "icky" depth */
-       character_icky++;
+       current_world_ptr->character_icky++;
 
        command_arg = 0;
        command_rep = 0;
@@ -4204,7 +4204,7 @@ void do_cmd_bldg(void)
        }
 
        /* Hack -- Decrease "icky" depth */
-       character_icky--;
+       current_world_ptr->character_icky--;
 
        Term_clear();
 
index 79810cb..5f32597 100644 (file)
@@ -1638,7 +1638,7 @@ void do_cmd_options_aux(int page, concptr info)
        int     i, k = 0, n = 0, l;
        int     opt[24];
        char    buf[80];
-       bool    browse_only = (page == OPT_PAGE_BIRTH) && character_generated &&
+       bool    browse_only = (page == OPT_PAGE_BIRTH) && current_world_ptr->character_generated &&
                              (!p_ptr->wizard || !allow_debug_opts);
 
 
index 1d84f22..d033d7a 100644 (file)
@@ -18,6 +18,7 @@
 #include "cmd-basic.h"
 #include "view-mainwindow.h"
 #include "targeting.h"
+#include "world.h"
 
 /*!
 * @brief プレイヤーの騎乗/下馬処理判定
 bool player_can_ride_aux(grid_type *g_ptr, bool now_riding)
 {
        bool p_can_enter;
-       bool old_character_xtra = character_xtra;
+       bool old_character_xtra = current_world_ptr->character_xtra;
        MONSTER_IDX old_riding = p_ptr->riding;
        bool old_riding_ryoute = p_ptr->riding_ryoute;
        bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
        bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
 
        /* Hack -- prevent "icky" message */
-       character_xtra = TRUE;
+       current_world_ptr->character_xtra = TRUE;
 
        if (now_riding) p_ptr->riding = g_ptr->m_idx;
        else
@@ -59,7 +60,7 @@ bool player_can_ride_aux(grid_type *g_ptr, bool now_riding)
        p_ptr->update |= PU_BONUS;
        handle_stuff();
 
-       character_xtra = old_character_xtra;
+       current_world_ptr->character_xtra = old_character_xtra;
 
        return p_can_enter;
 }
index bcf0df8..41ba0a2 100644 (file)
@@ -4985,7 +4985,7 @@ static void dungeon(bool load_game)
 
 
        /* Enter "xtra" mode */
-       character_xtra = TRUE;
+       current_world_ptr->character_xtra = TRUE;
 
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
        p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
@@ -4994,7 +4994,7 @@ static void dungeon(bool load_game)
        handle_stuff();
 
        /* Leave "xtra" mode */
-       character_xtra = FALSE;
+       current_world_ptr->character_xtra = FALSE;
 
        p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
        p_ptr->update |= (PU_COMBINE | PU_REORDER);
@@ -5270,7 +5270,7 @@ void play_game(bool new_game)
        p_ptr->hack_mutation = FALSE;
 
        /* Hack -- Character is "icky" */
-       character_icky = TRUE;
+       current_world_ptr->character_icky = TRUE;
 
        /* Make sure main term is active */
        Term_activate(angband_term[0]);
@@ -5321,7 +5321,7 @@ void play_game(bool new_game)
                signals_ignore_tstp();
                
                /* Hack -- Character is now "icky" */
-               character_icky = TRUE;
+               current_world_ptr->character_icky = TRUE;
 
                /* Build the filename */
                path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
@@ -5358,16 +5358,16 @@ void play_game(bool new_game)
                quit(0);
        }
 
-       creating_savefile = new_game;
+       current_world_ptr->creating_savefile = new_game;
 
        /* Nothing loaded */
-       if (!character_loaded)
+       if (!current_world_ptr->character_loaded)
        {
                /* Make new player */
                new_game = TRUE;
 
                /* The dungeon is not ready */
-               character_dungeon = FALSE;
+               current_world_ptr->character_dungeon = FALSE;
 
                /* Prepare to init the RNG */
                init_random_seed = TRUE;
@@ -5400,7 +5400,7 @@ void play_game(bool new_game)
        if (new_game)
        {
                /* The dungeon is not ready */
-               character_dungeon = FALSE;
+               current_world_ptr->character_dungeon = FALSE;
 
                /* Start in town */
                current_floor_ptr->dun_level = 0;
@@ -5456,7 +5456,7 @@ void play_game(bool new_game)
                }
        }
 
-       creating_savefile = FALSE;
+       current_world_ptr->creating_savefile = FALSE;
 
        p_ptr->teleport_town = FALSE;
        p_ptr->sutemi = FALSE;
@@ -5529,7 +5529,7 @@ void play_game(bool new_game)
 
 
        /* Generate a dungeon level if needed */
-       if (!character_dungeon)
+       if (!current_world_ptr->character_dungeon)
        {
                change_floor();
        }
@@ -5555,11 +5555,11 @@ void play_game(bool new_game)
        }
 
        /* Character is now "complete" */
-       character_generated = TRUE;
+       current_world_ptr->character_generated = TRUE;
 
 
        /* Hack -- Character is no longer "icky" */
-       character_icky = FALSE;
+       current_world_ptr->character_icky = FALSE;
 
 
        if (new_game)
@@ -5629,11 +5629,11 @@ void play_game(bool new_game)
                dungeon(load_game);
 
                /* Hack -- prevent "icky" message */
-               character_xtra = TRUE;
+               current_world_ptr->character_xtra = TRUE;
 
                handle_stuff();
 
-               character_xtra = FALSE;
+               current_world_ptr->character_xtra = FALSE;
 
                /* Cancel the target */
                target_who = 0;
@@ -5797,7 +5797,7 @@ void close_game(void)
 
 
        /* Hack -- Character is now "icky" */
-       character_icky = TRUE;
+       current_world_ptr->character_icky = TRUE;
 
 
        /* Build the filename */
index 1f27de0..8694103 100644 (file)
@@ -51,13 +51,6 @@ extern const byte feature_action_flags[FF_FLAG_MAX];
 
 /* variable.c */
 
-extern bool character_generated;
-extern bool character_dungeon;
-extern bool character_loaded;
-extern bool character_saved;
-extern bool character_icky;
-extern bool character_xtra;
-extern bool creating_savefile;
 extern COMMAND_CODE command_cmd;
 extern COMMAND_ARG command_arg;
 extern s16b command_rep;
index fbf00f8..b2d3bb8 100644 (file)
@@ -630,7 +630,7 @@ errr process_pref_file_command(char *buf)
                                        int os = option_info[i].o_set;
                                        int ob = option_info[i].o_bit;
 
-                                       if ((p_ptr->playing || character_xtra) &&
+                                       if ((p_ptr->playing || current_world_ptr->character_xtra) &&
                                                (OPT_PAGE_BIRTH == option_info[i].o_page) && !p_ptr->wizard)
                                        {
                                                msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not changed! '%s'"), buf);
@@ -4001,7 +4001,7 @@ void display_player(int mode)
 #endif
                                }
                        }
-                       else if (character_dungeon)
+                       else if (current_world_ptr->character_dungeon)
                        {
                                if (!current_floor_ptr->dun_level)
                                {
@@ -5809,7 +5809,7 @@ void process_player_name(bool sf)
        int i, k = 0;
        char old_player_base[32] = "";
 
-       if (character_generated) strcpy(old_player_base, player_base);
+       if (current_world_ptr->character_generated) strcpy(old_player_base, player_base);
 
        /* Cannot be too long */
 #if defined(MACINTOSH) || defined(ACORN)
@@ -5946,7 +5946,7 @@ void process_player_name(bool sf)
        }
 
        /* Load an autopick preference file */
-       if (character_generated)
+       if (current_world_ptr->character_generated)
        {
                if (!streq(old_player_base, player_base)) autopick_load_pref(FALSE);
        }
@@ -6622,7 +6622,7 @@ bool check_score(void)
 void exit_game_panic(void)
 {
        /* If nothing important has happened, just quit */
-       if (!character_generated || character_saved) quit(_("緊急事態", "panic"));
+       if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(_("緊急事態", "panic"));
 
        /* Mega-Hack -- see "msg_print()" */
        msg_flag = FALSE;
@@ -6821,17 +6821,17 @@ errr process_histpref_file(concptr name)
 {
        char buf[1024];
        errr err = 0;
-       bool old_character_xtra = character_xtra;
+       bool old_character_xtra = current_world_ptr->character_xtra;
 
        /* Build the filename */
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
 
        /* Hack -- prevent modification birth options in this file */
-       character_xtra = TRUE;
+       current_world_ptr->character_xtra = TRUE;
 
        err = process_pref_file_aux(buf, PREF_TYPE_HISTPREF);
 
-       character_xtra = old_character_xtra;
+       current_world_ptr->character_xtra = old_character_xtra;
        return (err);
 }
 
@@ -7042,7 +7042,7 @@ static void handle_signal_simple(int sig)
 
 
        /* Nothing to save, just quit */
-       if (!character_generated || character_saved) quit(NULL);
+       if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
 
 
        /* Count the signals */
@@ -7145,7 +7145,7 @@ static void handle_signal_abort(int sig)
 
 
        /* Nothing to save, just quit */
-       if (!character_generated || character_saved) quit(NULL);
+       if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
 
 
        forget_lite();
index 1c8162a..d4d8a4a 100644 (file)
@@ -1083,7 +1083,7 @@ void change_floor(void)
        bool loaded = FALSE;
 
        /* The dungeon is not ready */
-       character_dungeon = FALSE;
+       current_world_ptr->character_dungeon = FALSE;
 
        /* No longer in the trap detecteded region */
        p_ptr->dtrap = FALSE;
@@ -1375,7 +1375,7 @@ void change_floor(void)
        p_ptr->floor_id = new_floor_id;
 
        /* The dungeon is ready */
-       character_dungeon = TRUE;
+       current_world_ptr->character_dungeon = TRUE;
 
        /* Hack -- Munchkin characters always get whole map */
        if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
index 564ab58..ee41b50 100644 (file)
@@ -230,7 +230,7 @@ typedef struct {
  */
 #define cave_empty_bold2(Y,X) \
        (cave_empty_bold(Y,X) && \
-        (character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
+        (current_world_ptr->character_dungeon || !cave_have_flag_bold((Y), (X), FF_TREE)))
 
 
 /*
index e619d70..bb245f7 100644 (file)
@@ -1737,7 +1737,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
        feature_type *f_ptr = &f_info[feat];
        bool old_los, old_mirror;
 
-       if (!character_dungeon)
+       if (!current_world_ptr->character_dungeon)
        {
                /* Clear mimic type */
                g_ptr->mimic = 0;
@@ -1929,7 +1929,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
                        found = TRUE;
                }
 
-               if (found && character_dungeon && player_can_see_bold(y, x))
+               if (found && current_world_ptr->character_dungeon && player_can_see_bold(y, x))
                {
                        msg_print(_("何かを発見した!", "You have found something!"));
                }
@@ -1939,7 +1939,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
        {
                feature_type *old_f_ptr = &f_info[oldfeat];
 
-               if (have_flag(old_f_ptr->flags, FF_GLASS) && character_dungeon)
+               if (have_flag(old_f_ptr->flags, FF_GLASS) && current_world_ptr->character_dungeon)
                {
                        project(PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(current_floor_ptr->dun_level, 100) / 4, GF_SHARDS,
                                (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
index ca42d50..43913e1 100644 (file)
@@ -2968,9 +2968,9 @@ static errr rd_dungeon_old(void)
 
        /* The dungeon is ready */
        if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena)
-               character_dungeon = FALSE;
+               current_world_ptr->character_dungeon = FALSE;
        else
-               character_dungeon = TRUE;
+               current_world_ptr->character_dungeon = TRUE;
 
        /* Success */
        return (0);
@@ -3416,7 +3416,7 @@ static errr rd_dungeon(void)
        }
 
        /* The dungeon is ready */
-       character_dungeon = TRUE;
+       current_world_ptr->character_dungeon = TRUE;
 
        /* Success or Error */
        return err;
index 2cf937b..9f13da8 100644 (file)
 #include "quest.h"
 #include "files.h"
 #include "core.h"
+#include "world.h"
 
 #ifdef WINDOWS
 #include <windows.h>
@@ -3497,7 +3498,7 @@ static void setup_menus(void)
 
 
        /* No character available */
-       if (!character_generated)
+       if (!current_world_ptr->character_generated)
        {
                /* Menu "File", Item "New" */
                EnableMenuItem(hm, IDM_FILE_NEW, MF_BYCOMMAND | MF_ENABLED);
@@ -3507,7 +3508,7 @@ static void setup_menus(void)
        }
 
        /* A character available */
-       if (character_generated)
+       if (current_world_ptr->character_generated)
        {
                /* Menu "File", Item "Save" */
                EnableMenuItem(hm, IDM_FILE_SAVE,
@@ -3811,7 +3812,7 @@ static void process_menus(WORD wCmd)
                /* Save game */
                case IDM_FILE_SAVE:
                {
-                       if (game_in_progress && character_generated)
+                       if (game_in_progress && current_world_ptr->character_generated)
                        {
                                if (!can_save)
                                {
@@ -3839,7 +3840,7 @@ static void process_menus(WORD wCmd)
                /* Exit */
                case IDM_FILE_EXIT:
                {
-                       if (game_in_progress && character_generated)
+                       if (game_in_progress && current_world_ptr->character_generated)
                        {
                                if (!can_save)
                                {
@@ -4785,7 +4786,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
 
                case WM_CLOSE:
                {
-                       if (game_in_progress && character_generated)
+                       if (game_in_progress && current_world_ptr->character_generated)
                        {
                                if (!can_save)
                                {
@@ -4815,7 +4816,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
 
                case WM_QUERYENDSESSION:
                {
-                       if (game_in_progress && character_generated)
+                       if (game_in_progress && current_world_ptr->character_generated)
                        {
                                /* Hack -- Forget messages */
                                msg_flag = FALSE;
index cd759d9..947128d 100644 (file)
@@ -2805,7 +2805,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                a_ptr->cur_num = 1;
 
                                /* Hack -- Memorize location of artifact in saved floors */
-                               if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+                               if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
                        }
                        else if (!preserve_mode) a_ptr->cur_num = 1;
                }
@@ -2977,7 +2977,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                        a_ptr->cur_num = 1;
 
                                        /* Hack -- Memorize location of artifact in saved floors */
-                                       if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+                                       if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
                                }
                                else if (!preserve_mode) a_ptr->cur_num = 1;
                        }
@@ -3000,7 +3000,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                                a_ptr->cur_num = 1;
 
                                                /* Hack -- Memorize location of artifact in saved floors */
-                                               if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+                                               if (current_world_ptr->character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
                                        }
                                        else if (!preserve_mode) a_ptr->cur_num = 1;
 
index 489676b..0eeed83 100644 (file)
@@ -480,7 +480,7 @@ MONSTER_IDX m_pop(void)
        }
 
        /* Warn the player (except during dungeon creation) */
-       if (character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
+       if (current_world_ptr->character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
 
        /* Try not to crash */
        return (0);
@@ -2790,14 +2790,14 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
         * Memorize location of the unique monster in saved floors.
         * A unique monster move from old saved floor.
         */
-       if (character_dungeon &&
+       if (current_world_ptr->character_dungeon &&
            ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)))
                real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
 
        /* Hack -- Count the number of "reproducers" */
        if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
 
-       if (p_ptr->warning && character_dungeon)
+       if (p_ptr->warning && current_world_ptr->character_dungeon)
        {
                if (r_ptr->flags1 & RF1_UNIQUE)
                {
index ff4528d..2deb01c 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "angband.h"
 #include "util.h"
+#include "world.h"
 
 #include "object.h"
 
@@ -429,7 +430,7 @@ void wipe_o_list(void)
                if (!o_ptr->k_idx) continue;
 
                /* Mega-Hack -- preserve artifacts */
-               if (!character_dungeon || preserve_mode)
+               if (!current_world_ptr->character_dungeon || preserve_mode)
                {
                        /* Hack -- Preserve unknown artifacts */
                        if (object_is_fixed_artifact(o_ptr) && !object_is_known(o_ptr))
@@ -521,7 +522,7 @@ OBJECT_IDX o_pop(void)
 
 
        /* Warn the player (except during dungeon creation) */
-       if (character_dungeon) msg_print(_("アイテムが多すぎる!", "Too many objects!"));
+       if (current_world_ptr->character_dungeon) msg_print(_("アイテムが多すぎる!", "Too many objects!"));
 
        return (0);
 }
@@ -3999,7 +4000,7 @@ void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
                a_ptr->cur_num = 1;
 
                /* Hack -- Memorize location of artifact in saved floors */
-               if (character_dungeon)
+               if (current_world_ptr->character_dungeon)
                        a_ptr->floor_id = p_ptr->floor_id;
 
                /* Extract the other fields */
index 8a6d0e5..534dc22 100644 (file)
@@ -2767,7 +2767,7 @@ void calc_bonuses(void)
 
 
        /* Hack -- handle "xtra" mode */
-       if (character_xtra) return;
+       if (current_world_ptr->character_xtra) return;
 
        /* Take note when "heavy bow" changes */
        if (p_ptr->old_heavy_shoot != p_ptr->heavy_shoot)
@@ -3227,10 +3227,10 @@ static void calc_spells(void)
        if (!mp_ptr->spell_book) return;
 
        /* Hack -- wait for creation */
-       if (!character_generated) return;
+       if (!current_world_ptr->character_generated) return;
 
        /* Hack -- handle "xtra" mode */
-       if (character_xtra) return;
+       if (current_world_ptr->character_xtra) return;
 
        if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
        {
@@ -3826,7 +3826,7 @@ static void calc_mana(void)
 
 
        /* Hack -- handle "xtra" mode */
-       if (character_xtra) return;
+       if (current_world_ptr->character_xtra) return;
 
        /* Take note when "glove state" changes */
        if (p_ptr->old_cumber_glove != p_ptr->cumber_glove)
@@ -4072,10 +4072,10 @@ void update_creature(player_type *creature_ptr)
        }
 
        /* Character is not ready yet, no screen updates */
-       if (!character_generated) return;
+       if (!current_world_ptr->character_generated) return;
 
        /* Character is in "icky" mode, no screen updates */
-       if (character_icky) return;
+       if (current_world_ptr->character_icky) return;
 
        if (creature_ptr->update & (PU_UN_LITE))
        {
@@ -4241,7 +4241,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
 {
        int power = 100;
 
-       if (p_ptr->inside_battle || !character_dungeon) return;
+       if (p_ptr->inside_battle || !current_world_ptr->character_dungeon) return;
 
        if (!necro && m_ptr)
        {
index 917e5e6..83db607 100644 (file)
@@ -1,6 +1,7 @@
 #include "angband.h"
 #include "util.h"
 
+#include "world.h"
 #include "cmd-spell.h"
 #include "floor.h"
 #include "spells.h"
index 8b15d29..cdbdb81 100644 (file)
@@ -1576,7 +1576,7 @@ static bool save_player_aux(char *name)
        counts_write(0, current_world_ptr->play_time);
 
        /* Successful save */
-       character_saved = TRUE;
+       current_world_ptr->character_saved = TRUE;
 
        /* Success */
        return (TRUE);
@@ -1651,7 +1651,7 @@ bool save_player(void)
                safe_setuid_drop();
 
                /* Hack -- Pretend the character was loaded */
-               character_loaded = TRUE;
+               current_world_ptr->character_loaded = TRUE;
 
 #ifdef VERIFY_SAVEFILE
 
@@ -1712,7 +1712,7 @@ bool save_player(void)
  * allowed to save his game when he quits.
  *
  * We return "TRUE" if the savefile was usable, and we set the global
- * flag "character_loaded" if a real, living, character was loaded.
+ * flag "current_world_ptr->character_loaded" if a real, living, character was loaded.
  *
  * Note that we always try to load the "current" savefile, even if
  * there is no such file, so we must check for "empty" savefile names.
@@ -1897,7 +1897,7 @@ bool load_player(void)
                        if (arg_wizard)
                        {
                                /* A character was loaded */
-                               character_loaded = TRUE;
+                               current_world_ptr->character_loaded = TRUE;
                                return (TRUE);
                        }
 
@@ -1911,7 +1911,7 @@ bool load_player(void)
                }
 
                /* A character was loaded */
-               character_loaded = TRUE;
+               current_world_ptr->character_loaded = TRUE;
 
                {
                        u32b tmp = counts_read(2);
index c00de76..0b8fadc 100644 (file)
@@ -5761,7 +5761,7 @@ void do_cmd_store(void)
        forget_view();
 
        /* Hack -- Character is in "icky" mode */
-       character_icky = TRUE;
+       current_world_ptr->character_icky = TRUE;
 
        /* command reset */
        command_arg = 0;
@@ -5861,7 +5861,7 @@ void do_cmd_store(void)
                need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
 
                /* Hack -- Character is still in "icky" mode */
-               character_icky = TRUE;
+               current_world_ptr->character_icky = TRUE;
 
                handle_stuff();
 
@@ -5945,7 +5945,7 @@ void do_cmd_store(void)
        take_turn(p_ptr, 100);
 
        /* Hack -- Character is no longer in "icky" mode */
-       character_icky = FALSE;
+       current_world_ptr->character_icky = FALSE;
 
        /* Hack -- Cancel automatic command */
        command_new = 0;
index 540a64b..a79160d 100644 (file)
@@ -2089,7 +2089,7 @@ char (*inkey_hack)(int flush_first) = NULL;
  * is only requested (via "Term_inkey()") when "angband_term[0]" is active.
  *
  * Mega-Hack -- This function is used as the entry point for clearing the
- * "signal_count" variable, and of the "character_saved" variable.
+ * "signal_count" variable, and of the "current_world_ptr->character_saved" variable.
  *
  * Hack -- Note the use of "inkey_next" to allow "keymaps" to be processed.
  *
@@ -2154,7 +2154,7 @@ char inkey(void)
        (void)Term_get_cursor(&v);
 
        /* Show the cursor if waiting, except sometimes in "command" mode */
-       if (!inkey_scan && (!inkey_flag || hilite_player || character_icky))
+       if (!inkey_scan && (!inkey_flag || hilite_player || current_world_ptr->character_icky))
        {
                /* Show the cursor */
                (void)Term_set_cursor(1);
@@ -2189,7 +2189,7 @@ char inkey(void)
                        Term_activate(angband_term[0]);
 
                        /* Mega-Hack -- reset saved flag */
-                       character_saved = FALSE;
+                       current_world_ptr->character_saved = FALSE;
 
                        /* Mega-Hack -- reset signal counter */
                        signal_count = 0;
@@ -2877,7 +2877,7 @@ void msg_print(concptr msg)
        n = strlen(buf);
 
        /* Memorize the message */
-       if (character_generated) message_add(buf);
+       if (current_world_ptr->character_generated) message_add(buf);
 
        /* Analyze the buffer */
        t = buf;
@@ -2941,7 +2941,7 @@ void msg_print(concptr msg)
                msg_flush(split + 1);
 
                /* Memorize the piece */
-               /* if (character_generated) message_add(t); */
+               /* if (current_world_ptr->character_generated) message_add(t); */
 
                /* Restore the split character */
                t[split] = oops;
@@ -2957,7 +2957,7 @@ void msg_print(concptr msg)
        Term_putstr(p, 0, n, TERM_WHITE, t);
 
        /* Memorize the tail */
-       /* if (character_generated) message_add(t); */
+       /* if (current_world_ptr->character_generated) message_add(t); */
 
        p_ptr->window |= (PW_MESSAGE);
        update_output();
@@ -3015,7 +3015,7 @@ void screen_save(void)
        if (screen_depth++ == 0) Term_save();
 
        /* Increase "icky" depth */
-       character_icky++;
+       current_world_ptr->character_icky++;
 }
 
 
@@ -3033,7 +3033,7 @@ void screen_load(void)
        if (--screen_depth == 0) Term_load();
 
        /* Decrease "icky" depth */
-       character_icky--;
+       current_world_ptr->character_icky--;
 }
 
 
index 2f3da49..65c3bcb 100644 (file)
 
 int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
 
-/*
- * Various things
- */
-bool character_generated;      /* The character exists */
-bool character_dungeon;                /* The character has a dungeon */
-bool character_loaded;         /* The character was loaded from a savefile */
-bool character_saved;          /* The character was just saved to a savefile */
-
-bool character_icky;           /* The game is in an icky full screen mode */
-bool character_xtra;           /* The game is in an icky startup mode */
-
-bool creating_savefile;                /* New savefile is currently created */
 
 s16b command_cmd;              /* Current "Angband Command" */
 
index a69ab91..04826d6 100644 (file)
@@ -2067,10 +2067,10 @@ static void redraw_stuff(void)
        if (!p_ptr->redraw) return;
 
        /* Character is not ready yet, no screen updates */
-       if (!character_generated) return;
+       if (!current_world_ptr->character_generated) return;
 
        /* Character is in "icky" mode, no screen updates */
-       if (character_icky) return;
+       if (current_world_ptr->character_icky) return;
 
        /* Hack -- clear the screen */
        if (p_ptr->redraw & (PR_WIPE))
@@ -2382,7 +2382,7 @@ void update_playtime(void)
 void resize_map(void)
 {
        /* Only if the dungeon exists */
-       if (!character_dungeon) return;
+       if (!current_world_ptr->character_dungeon) return;
 
        /* Mega-Hack -- no panel yet */
        panel_row_max = 0;
@@ -2420,7 +2420,7 @@ void resize_map(void)
 void redraw_window(void)
 {
        /* Only if the dungeon exists */
-       if (!character_dungeon) return;
+       if (!current_world_ptr->character_dungeon) return;
 
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
        p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
index 2c12347..f733386 100644 (file)
@@ -40,6 +40,16 @@ typedef struct {
        u16b sf_lives;                  /* Number of past "lives" with this file */
        u16b sf_saves;                  /* Number of "saves" during this life */
 
+       bool character_generated;       /* The character exists */
+       bool character_dungeon;         /* The character has a dungeon */
+       bool character_loaded;          /* The character was loaded from a savefile */
+       bool character_saved;           /* The character was just saved to a savefile */
+
+       bool character_icky;            /* The game is in an icky full screen mode */
+       bool character_xtra;            /* The game is in an icky startup mode */
+
+       bool creating_savefile;         /* New savefile is currently created */
+
 } world_type;
 
 extern bool is_daytime(void);