OSDN Git Service

[Refactor] #40467 Moved load_wilderness_info() and analyze_wilderness() from exe_read...
authorHourier <hourier@users.sourceforge.jp>
Sun, 5 Jul 2020 13:15:06 +0000 (22:15 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 5 Jul 2020 13:15:06 +0000 (22:15 +0900)
src/savedata/load.c
src/savedata/world-loader.c
src/savedata/world-loader.h

index cc2f476..174e935 100644 (file)
@@ -265,45 +265,6 @@ static void analyze_quests(player_type *creature_ptr, const u16b max_quests_load
     }
 }
 
-static void load_wilderness_info(player_type *creature_ptr)
-{
-    rd_s32b(&creature_ptr->wilderness_x);
-    rd_s32b(&creature_ptr->wilderness_y);
-    if (z_older_than(10, 3, 13)) {
-        creature_ptr->wilderness_x = 5;
-        creature_ptr->wilderness_y = 48;
-    }
-
-    if (z_older_than(10, 3, 7))
-        creature_ptr->wild_mode = FALSE;
-    else
-        rd_byte((byte *)&creature_ptr->wild_mode);
-
-    if (z_older_than(10, 3, 7))
-        creature_ptr->ambush_flag = FALSE;
-    else
-        rd_byte((byte *)&creature_ptr->ambush_flag);
-}
-
-static errr analyze_wilderness(void)
-{
-    s32b wild_x_size;
-    s32b wild_y_size;
-    rd_s32b(&wild_x_size);
-    rd_s32b(&wild_y_size);
-
-    if ((wild_x_size > current_world_ptr->max_wild_x) || (wild_y_size > current_world_ptr->max_wild_y)) {
-        load_note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
-        return (23);
-    }
-
-    for (int i = 0; i < wild_x_size; i++)
-        for (int j = 0; j < wild_y_size; j++)
-            rd_u32b(&wilderness[j][i].seed);
-
-    return 0;
-}
-
 /*!
  * @brief 変愚蛮怒 v2.1.3で追加された街とクエストについて読み込む
  * @param creature_ptr プレーヤーへの参照ポインタ
index 594e5e9..8fdd27f 100644 (file)
@@ -2,6 +2,7 @@
 #include "cmd-building/cmd-building.h"
 #include "dungeon/dungeon.h"
 #include "floor/floor.h"
+#include "floor/wild.h"
 #include "market/bounty.h"
 #include "savedata/angband-version-comparer.h"
 #include "savedata/load-util.h"
@@ -155,3 +156,42 @@ void rd_global_configurations(player_type *creature_ptr)
     rd_byte(&creature_ptr->feeling);
     rd_world_info(creature_ptr);
 }
+
+void load_wilderness_info(player_type *creature_ptr)
+{
+    rd_s32b(&creature_ptr->wilderness_x);
+    rd_s32b(&creature_ptr->wilderness_y);
+    if (z_older_than(10, 3, 13)) {
+        creature_ptr->wilderness_x = 5;
+        creature_ptr->wilderness_y = 48;
+    }
+
+    if (z_older_than(10, 3, 7))
+        creature_ptr->wild_mode = FALSE;
+    else
+        rd_byte((byte *)&creature_ptr->wild_mode);
+
+    if (z_older_than(10, 3, 7))
+        creature_ptr->ambush_flag = FALSE;
+    else
+        rd_byte((byte *)&creature_ptr->ambush_flag);
+}
+
+errr analyze_wilderness(void)
+{
+    s32b wild_x_size;
+    s32b wild_y_size;
+    rd_s32b(&wild_x_size);
+    rd_s32b(&wild_y_size);
+
+    if ((wild_x_size > current_world_ptr->max_wild_x) || (wild_y_size > current_world_ptr->max_wild_y)) {
+        load_note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
+        return (23);
+    }
+
+    for (int i = 0; i < wild_x_size; i++)
+        for (int j = 0; j < wild_y_size; j++)
+            rd_u32b(&wilderness[j][i].seed);
+
+    return 0;
+}
index 64b336e..a6f9199 100644 (file)
@@ -8,3 +8,5 @@ void set_gambling_monsters(void);
 void rd_autopick(player_type *creature_ptr);
 void rd_visited_towns(player_type *creature_ptr);
 void rd_global_configurations(player_type *creature_ptr);
+void load_wilderness_info(player_type *creature_ptr);
+errr analyze_wilderness(void);