OSDN Git Service

呪いは外れないだけではなく、いろいろイヤな効果がある。
[hengbandforosx/hengbandosx.git] / src / save.c
index 147e44e..460f8d1 100644 (file)
@@ -568,6 +568,8 @@ static void wr_item(object_type *o_ptr)
        wr_u32b(o_ptr->art_flags2);
        wr_u32b(o_ptr->art_flags3);
 
+       wr_u32b(o_ptr->curse_flags);
+
        /* Held by monster index */
        wr_s16b(o_ptr->held_m_idx);
 
@@ -601,27 +603,8 @@ static void wr_item(object_type *o_ptr)
                wr_string("");
        }
 
-#ifdef USE_SCRIPT
-       {
-               cptr python_object = object_save_callback(o_ptr);
-               if (python_object && *python_object)
-               {
-                       wr_s32b(strlen(python_object));
-                       wr_string(python_object);
-                       string_free(python_object);
-               }
-               else
-               {
-                       /* No Python object */
-                       wr_s32b(0);
-               }
-       }
-#else /* USE_SCRIPT */
-
        /* No Python object */
        wr_s32b(0);
-
-#endif /* USE_SCRIPT */
 }
 
 
@@ -891,7 +874,7 @@ static void wr_ghost(void)
 
        /* Name */
 #ifdef JP
-wr_string("ÉÔÀµ¤Ê¥´¡¼¥¹¥È");
+       wr_string("ÉÔÀµ¤Ê¥´¡¼¥¹¥È");
 #else
        wr_string("Broken Ghost");
 #endif
@@ -1154,7 +1137,7 @@ static void wr_dungeon(void)
        int i, y, x;
 
        byte tmp8u;
-       u16b tmp16s;
+       u16b tmp16u;
 
        byte count;
        byte prev_char;
@@ -1174,8 +1157,8 @@ static void wr_dungeon(void)
        wr_u16b((u16b)px);
        wr_u16b(cur_hgt);
        wr_u16b(cur_wid);
-       wr_u16b(max_panel_rows);
-       wr_u16b(max_panel_cols);
+       wr_u16b(0); /* max_panel_rows */
+       wr_u16b(0); /* max_panel_cols */
 
 
        /*** Simple "Run-Length-Encoding" of cave ***/
@@ -1193,14 +1176,14 @@ static void wr_dungeon(void)
                        c_ptr = &cave[y][x];
 
                        /* Extract a byte */
-                       tmp16s = c_ptr->info;
+                       tmp16u = c_ptr->info;
 
                        /* If the run is broken, or too full, flush it */
-                       if ((tmp16s != prev_s16b) || (count == MAX_UCHAR))
+                       if ((tmp16u != prev_s16b) || (count == MAX_UCHAR))
                        {
                                wr_byte((byte)count);
                                wr_u16b((u16b)prev_s16b);
-                               prev_s16b = tmp16s;
+                               prev_s16b = tmp16u;
                                count = 1;
                        }
 
@@ -1319,14 +1302,14 @@ static void wr_dungeon(void)
                        c_ptr = &cave[y][x];
 
                        /* Extract a byte */
-                       tmp16s = c_ptr->special;
+                       tmp16u = c_ptr->special;
 
                        /* If the run is broken, or too full, flush it */
-                       if ((tmp16s != prev_s16b) || (count == MAX_UCHAR))
+                       if ((tmp16u != prev_s16b) || (count == MAX_UCHAR))
                        {
                                wr_byte((byte)count);
                                wr_u16b(prev_s16b);
-                               prev_s16b = tmp16s;
+                               prev_s16b = tmp16u;
                                count = 1;
                        }
 
@@ -1346,11 +1329,6 @@ static void wr_dungeon(void)
        }
 
 
-       /* Compact the objects */
-       compact_objects(0);
-       /* Compact the monsters */
-       compact_monsters(0);
-
        /*** Dump objects ***/
 
        /* Total objects */
@@ -1397,6 +1375,11 @@ static bool wr_savefile_new(void)
        u16b            tmp16u;
 
 
+       /* Compact the objects */
+       compact_objects(0);
+       /* Compact the monsters */
+       compact_monsters(0);
+
        /* Guess at the current time */
        now = time((time_t *)0);
 
@@ -1422,7 +1405,7 @@ static bool wr_savefile_new(void)
        wr_byte(FAKE_VER_PATCH);
        xor_byte = 0;
 
-       tmp8u = (byte)rand_int(256);
+       tmp8u = (byte)randint0(256);
        wr_byte(tmp8u);
 
 
@@ -1621,6 +1604,16 @@ static bool wr_savefile_new(void)
        wr_s16b(p_ptr->pet_follow_distance);
        wr_s16b(p_ptr->pet_extra_flags);
 
+       /* Write screen dump for sending score */
+       if (screen_dump && (wait_report_score || !death))
+       {
+               wr_string(screen_dump);
+       }
+       else
+       {
+               wr_string("");
+       }
+
        /* Player is not dead, write the dungeon */
        if (!death)
        {
@@ -1630,28 +1623,8 @@ static bool wr_savefile_new(void)
                /* Dump the ghost */
                wr_ghost();
 
-#ifdef USE_SCRIPT
-               {
-                       cptr callbacks = callbacks_save_callback();
-                       if (callbacks && *callbacks)
-                       {
-                               wr_s32b(strlen(callbacks));
-                               wr_string(callbacks);
-                               string_free(callbacks);
-                       }
-                       else
-                       {
-                               /* No scripts */
-                               wr_s32b(0);
-                       }
-               }
-#else /* USE_SCRIPT */
-
                /* No scripts */
                wr_s32b(0);
-
-#endif /* USE_SCRIPT */
-
        }
 
 
@@ -1892,7 +1865,7 @@ bool load_player(void)
        {
                /* Give a message */
 #ifdef JP
-msg_print("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó¡£");
+               msg_print("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó¡£");
 #else
                msg_print("Savefile does not exist.");
 #endif
@@ -1930,7 +1903,7 @@ msg_print("
 
                        /* Message */
 #ifdef JP
-msg_print("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤Ï¸½ºß»ÈÍÑÃæ¤Ç¤¹¡£");
+                       msg_print("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤Ï¸½ºß»ÈÍÑÃæ¤Ç¤¹¡£");
 #else
                        msg_print("Savefile is currently in use.");
 #endif
@@ -1965,7 +1938,7 @@ msg_print("
 
                /* Message (below) */
 #ifdef JP
-if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò³«¤±¤Þ¤»¤ó¡£";
+               if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò³«¤±¤Þ¤»¤ó¡£";
 #else
                if (err) what = "Cannot open savefile";
 #endif
@@ -1986,7 +1959,7 @@ if (err) what = "
 
                /* What */
 #ifdef JP
-if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤òÆɤá¤Þ¤»¤ó¡£";
+               if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤òÆɤá¤Þ¤»¤ó¡£";
 #else
                if (err) what = "Cannot read savefile";
 #endif
@@ -2052,7 +2025,7 @@ if (err) what = "
 
                /* Message (below) */
 #ifdef JP
-if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò²òÀϽÐÍè¤Þ¤»¤ó¡£";
+               if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò²òÀϽÐÍè¤Þ¤»¤ó¡£";
 #else
                if (err) what = "Cannot parse savefile";
 #endif
@@ -2067,7 +2040,7 @@ if (err) what = "
 
                /* Message (below) */
 #ifdef JP
-if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹";
+               if (err) what = "¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹";
 #else
                if (err) what = "Broken savefile";
 #endif
@@ -2084,7 +2057,7 @@ if (err) what = "
                {
                        /* Message */
 #ifdef JP
-what = "̵¸ú¤Ê¥¿¥¤¥à¡¦¥¹¥¿¥ó¥×¤Ç¤¹";
+                       what = "̵¸ú¤Ê¥¿¥¤¥à¡¦¥¹¥¿¥ó¥×¤Ç¤¹";
 #else
                        what = "Invalid timestamp";
 #endif
@@ -2108,7 +2081,7 @@ what = "̵
                        if (z_major == 2 && z_minor == 0 && z_patch == 6)
                        {
 #ifdef JP
-msg_print("¥Ð¡¼¥¸¥ç¥ó 2.0.* ÍѤΥ»¡¼¥Ö¥Õ¥¡¥¤¥ë¤òÊÑ´¹¤·¤Þ¤·¤¿¡£");
+                               msg_print("¥Ð¡¼¥¸¥ç¥ó 2.0.* ÍѤΥ»¡¼¥Ö¥Õ¥¡¥¤¥ë¤òÊÑ´¹¤·¤Þ¤·¤¿¡£");
 #else
                                msg_print("Converted a 2.0.* savefile.");
 #endif
@@ -2118,7 +2091,7 @@ msg_print("
                        {
                                /* Message */
 #ifdef JP
-msg_format("¥Ð¡¼¥¸¥ç¥ó %d.%d.%d ÍѤΥ»¡¼¥Ö¡¦¥Õ¥¡¥¤¥ë¤òÊÑ´¹¤·¤Þ¤·¤¿¡£",
+                               msg_format("¥Ð¡¼¥¸¥ç¥ó %d.%d.%d ÍѤΥ»¡¼¥Ö¡¦¥Õ¥¡¥¤¥ë¤òÊÑ´¹¤·¤Þ¤·¤¿¡£",
 #else
                                msg_format("Converted a %d.%d.%d savefile.",
 #endif
@@ -2191,7 +2164,7 @@ msg_format("
 
        /* Message */
 #ifdef JP
-msg_format("¥¨¥é¡¼(%s)¤¬¥Ð¡¼¥¸¥ç¥ó%d.%d.%d ÍÑ¥»¡¼¥Ö¥Õ¥¡¥¤¥ëÆɤ߹þÃæ¤ËȯÀ¸¡£",
+       msg_format("¥¨¥é¡¼(%s)¤¬¥Ð¡¼¥¸¥ç¥ó%d.%d.%d ÍÑ¥»¡¼¥Ö¥Õ¥¡¥¤¥ëÆɤ߹þÃæ¤ËȯÀ¸¡£",
 #else
        msg_format("Error (%s) reading %d.%d.%d savefile.",
 #endif