OSDN Git Service

[Refactor] #40467 Separated rd_race() from extra-loader.c to player-info-loader.c/h
authorHourier <hourier@users.sourceforge.jp>
Sun, 5 Jul 2020 05:43:58 +0000 (14:43 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 5 Jul 2020 05:43:58 +0000 (14:43 +0900)
src/savedata/extra-loader.c
src/savedata/player-info-loader.c
src/savedata/player-info-loader.h

index a238355..2a62d2e 100644 (file)
@@ -47,19 +47,6 @@ static void rd_base_status(player_type *creature_ptr)
         rd_s16b(&creature_ptr->stat_cur[i]);
 }
 
-static void set_race(player_type *creature_ptr)
-{
-    byte tmp8u;
-    rd_byte(&tmp8u);
-    creature_ptr->start_race = (player_race_type)tmp8u;
-    s32b tmp32s;
-    rd_s32b(&tmp32s);
-    creature_ptr->old_race1 = (BIT_FLAGS)tmp32s;
-    rd_s32b(&tmp32s);
-    creature_ptr->old_race2 = (BIT_FLAGS)tmp32s;
-    rd_s16b(&creature_ptr->old_realm);
-}
-
 static void set_imitation(player_type *creature_ptr)
 {
     if (z_older_than(10, 0, 1)) {
@@ -206,11 +193,7 @@ void rd_extra(player_type *creature_ptr)
     rd_s32b(&creature_ptr->au);
     rd_experience(creature_ptr);
     rd_skills(creature_ptr);
-    if (z_older_than(11, 0, 7))
-        set_zangband_race(creature_ptr);
-    else
-        set_race(creature_ptr);
-
+    rd_race(creature_ptr);
     set_imitation(creature_ptr);
     if (z_older_than(10, 0, 3))
         set_zangband_bounty_uniques(creature_ptr);
index f2c8931..4a51bca 100644 (file)
@@ -109,3 +109,26 @@ void rd_skills(player_type *creature_ptr)
     if (music_singing_any(creature_ptr))
         creature_ptr->action = ACTION_SING;
 }
+
+static void set_race(player_type *creature_ptr)
+{
+    byte tmp8u;
+    rd_byte(&tmp8u);
+    creature_ptr->start_race = (player_race_type)tmp8u;
+    s32b tmp32s;
+    rd_s32b(&tmp32s);
+    creature_ptr->old_race1 = (BIT_FLAGS)tmp32s;
+    rd_s32b(&tmp32s);
+    creature_ptr->old_race2 = (BIT_FLAGS)tmp32s;
+    rd_s16b(&creature_ptr->old_realm);
+}
+
+void rd_race(player_type *creature_ptr)
+{
+    if (z_older_than(11, 0, 7)) {
+        set_zangband_race(creature_ptr);
+        return;
+    }
+    
+    set_race(creature_ptr);
+}
\ No newline at end of file
index 858e5ec..fecde00 100644 (file)
@@ -5,3 +5,4 @@
 void rd_base_info(player_type *creature_ptr);
 void rd_experience(player_type *creature_ptr);
 void rd_skills(player_type *creature_ptr);
+void rd_race(player_type *creature_ptr);