OSDN Git Service

[Refactor] #40467 Moved restore_dungeon() from load.c to dungeon-loader.c/h
authorHourier <hourier@users.sourceforge.jp>
Sun, 5 Jul 2020 13:08:08 +0000 (22:08 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 5 Jul 2020 13:08:08 +0000 (22:08 +0900)
src/savedata/dungeon-loader.c
src/savedata/dungeon-loader.h
src/savedata/load.c

index 751e580..81b69fd 100644 (file)
@@ -1,7 +1,11 @@
 #include "savedata/dungeon-loader.h"
+#include "dungeon/quest.h"
 #include "floor/floor-save.h"
 #include "floor/floor.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-flags1.h"
 #include "savedata/angband-version-comparer.h"
+#include "savedata/dummy-loader.h"
 #include "savedata/floor-loader.h"
 #include "savedata/load-util.h"
 #include "savedata/load-v1-5-0.h"
@@ -16,7 +20,7 @@
  * The monsters/objects must be loaded in the same order
  * that they were stored, since the actual indexes matter.
  */
-errr rd_dungeon(player_type *player_ptr)
+static errr rd_dungeon(player_type *player_ptr)
 {
     init_saved_floors(player_ptr, FALSE);
     errr err = 0;
@@ -114,3 +118,25 @@ errr rd_dungeon(player_type *player_ptr)
     current_world_ptr->character_dungeon = TRUE;
     return err;
 }
+
+errr restore_dungeon(player_type *creature_ptr)
+{
+    if (creature_ptr->is_dead) {
+        for (int i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
+            r_info[quest[i].r_idx].flags1 &= ~RF1_QUESTOR;
+
+        return 0;
+    }
+
+    load_note(_("ダンジョン復元中...", "Restoring Dungeon..."));
+    if (rd_dungeon(creature_ptr)) {
+        load_note(_("ダンジョンデータ読み込み失敗", "Error reading dungeon data"));
+        return 34;
+    }
+
+    rd_ghost();
+    s32b tmp32s;
+    rd_s32b(&tmp32s);
+    strip_bytes(tmp32s);
+    return 0;
+}
index 1a63691..0735a21 100644 (file)
@@ -2,4 +2,4 @@
 
 #include "system/angband.h"
 
-errr rd_dungeon(player_type *player_ptr);
+errr restore_dungeon(player_type *creature_ptr);
index b5d3afa..d26c914 100644 (file)
@@ -450,28 +450,6 @@ static errr load_store(player_type *creature_ptr)
     return 0;
 }
 
-static errr restore_dungeon(player_type *creature_ptr)
-{
-    if (creature_ptr->is_dead) {
-        for (int i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
-            r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
-
-        return 0;
-    }
-    
-    load_note(_("ダンジョン復元中...", "Restoring Dungeon..."));
-    if (rd_dungeon(creature_ptr)) {
-        load_note(_("ダンジョンデータ読み込み失敗", "Error reading dungeon data"));
-        return 34;
-    }
-
-    rd_ghost();
-    s32b tmp32s;
-    rd_s32b(&tmp32s);
-    strip_bytes(tmp32s);
-    return 0;
-}
-
 static errr verify_checksum()
 {
     u32b n_v_check = v_check;