OSDN Git Service

[Refactor] #38844 is_loading_now を world_type 構造体へ移動.
authordeskull <deskull@users.sourceforge.jp>
Sun, 5 May 2019 02:37:37 +0000 (11:37 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 5 May 2019 02:40:45 +0000 (11:40 +0900)
src/core.c
src/externs.h
src/files.c
src/player-status.c
src/variable.c
src/world.h

index 1f80320..e24aad1 100644 (file)
@@ -4909,7 +4909,7 @@ static void dungeon(bool load_game)
        current_floor_ptr->base_level = current_floor_ptr->dun_level;
 
        /* Reset various flags */
-       is_loading_now = FALSE;
+       current_world_ptr->is_loading_now = FALSE;
 
        /* Not leaving */
        p_ptr->leaving = FALSE;
@@ -5050,7 +5050,7 @@ static void dungeon(bool load_game)
        /* Reset the object generation level */
        current_floor_ptr->object_level = current_floor_ptr->base_level;
 
-       is_loading_now = TRUE;
+       current_world_ptr->is_loading_now = TRUE;
 
        if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
            (current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
index e21b0f2..fed6a3b 100644 (file)
@@ -146,7 +146,6 @@ extern int total_friends;
 extern int leaving_quest;
 extern bool reinit_wilderness;
 extern bool multi_rew;
-extern bool is_loading_now;
 extern bool reset_concent;
 extern bool is_fired;
 
index bbb7b46..4782904 100644 (file)
@@ -6057,7 +6057,7 @@ void do_cmd_save_game(int is_autosave)
        (void)strcpy(p_ptr->died_from, _("(元気に生きている)", "(alive and well)"));
 
        /* HACK -- don't get sanity blast on updating view */
-       is_loading_now = FALSE;
+       current_world_ptr->is_loading_now = FALSE;
 
        update_creature(p_ptr);
 
@@ -6065,7 +6065,7 @@ void do_cmd_save_game(int is_autosave)
        mproc_init();
 
        /* HACK -- reset the hackish flag */
-       is_loading_now = TRUE;
+       current_world_ptr->is_loading_now = TRUE;
 }
 
 
index 3b8a8db..fb2f560 100644 (file)
@@ -31,6 +31,7 @@
 #include "autopick.h"
 #include "cmd-dump.h"
 #include "melee.h"
+#include "world.h"
 
 /*!
  * @var horror_desc
@@ -2813,7 +2814,7 @@ void calc_bonuses(void)
                        if (p_ptr->icky_wield[i])
                        {
                                msg_print(_("今の装備はどうも自分にふさわしくない気がする。", "You do not feel comfortable with your weapon."));
-                               if (is_loading_now)
+                               if (current_world_ptr->is_loading_now)
                                {
                                        chg_virtue(V_FAITH, -1);
                                }
@@ -2859,7 +2860,7 @@ void calc_bonuses(void)
                if (heavy_armor())
                {
                        msg_print(_("装備が重くてバランスを取れない。", "The weight of your armor disrupts your balance."));
-                       if (is_loading_now)
+                       if (current_world_ptr->is_loading_now)
                        {
                                chg_virtue(V_HARMONY, -1);
                        }
@@ -4232,7 +4233,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
                }
                else power *= 2;
 
-               if (!is_loading_now)
+               if (!current_world_ptr->is_loading_now)
                        return; /* No effect yet, just loaded... */
 
                if (!m_ptr->ml)
index ce437b3..209cd10 100644 (file)
@@ -126,8 +126,6 @@ bool shimmer_objects;       /* Hack -- optimize multi-hued objects */
 bool repair_monsters;  /* Hack -- optimize detect monsters */
 bool repair_objects;   /* Hack -- optimize detect objects */
 
-bool is_loading_now;   /*!< ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
-
 MONSTER_IDX hack_m_idx = 0;    /* Hack -- see "process_monsters()" */
 MONSTER_IDX hack_m_idx_ii = 0;
 
index 2d9222a..b719295 100644 (file)
@@ -16,6 +16,8 @@ typedef struct {
        u32b seed_flavor;               /* Hack -- consistent object colors */
        u32b seed_town;                 /* Hack -- consistent town layout */
 
+       bool is_loading_now;    /*!< ロード処理中フラグ...ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
+
 } world_type;
 
 extern bool is_daytime(void);