OSDN Git Service

[Refactor] #37353 ウィザードモードフラグ を player_type 構造体から world_type 構造体へ移動.
[hengband/hengband.git] / src / save.c
index 8b15d29..44ad47a 100644 (file)
@@ -15,7 +15,9 @@
 #include "util.h"
 #include "save.h"
 #include "load.h"
+#include "report.h"
 
+#include "core.h"
 #include "artifact.h"
 #include "sort.h"
 #include "dungeon.h"
@@ -482,7 +484,7 @@ static void wr_options(void)
 
        c = 0;
 
-       if (p_ptr->wizard) c |= 0x0002;
+       if (current_world_ptr->wizard) c |= 0x0002;
 
        if (cheat_sight) c |= 0x0040;
        if (cheat_turn) c |= 0x0080;
@@ -520,11 +522,8 @@ static void wr_options(void)
                                /* Set */
                                option_flag[os] |= (1L << ob);
                        }
-
-                       /* Clear */
                        else
                        {
-                               /* Clear */
                                option_flag[os] &= ~(1L << ob);
                        }
                }
@@ -695,7 +694,7 @@ static void wr_extra(void)
        wr_s16b(p_ptr->arena_number);
        wr_s16b(p_ptr->inside_arena);
        wr_s16b(p_ptr->inside_quest);
-       wr_s16b(p_ptr->inside_battle);
+       wr_s16b(p_ptr->phase_out);
        wr_byte(p_ptr->exit_bldg);
        wr_byte(0); /* Unused */
 
@@ -846,7 +845,7 @@ static void wr_extra(void)
 
        wr_s32b(current_world_ptr->dungeon_turn);
 
-       wr_s32b(old_battle);
+       wr_s32b(current_world_ptr->arena_start_turn);
 
        wr_s16b(today_mon);
        wr_s16b(p_ptr->today_mon);
@@ -1576,7 +1575,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 +1650,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 +1711,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 +1896,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 +1910,7 @@ bool load_player(void)
                }
 
                /* A character was loaded */
-               character_loaded = TRUE;
+               current_world_ptr->character_loaded = TRUE;
 
                {
                        u32b tmp = counts_read(2);