OSDN Git Service

[Fix] #40913 Windows以外で新規のセーブデータを作成できない不具合を解消した / Resolved the issue that new game...
authorHourier <hourier@users.sourceforge.jp>
Tue, 3 Nov 2020 12:51:03 +0000 (21:51 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 4 Nov 2020 14:59:53 +0000 (23:59 +0900)
src/core/game-play.c
src/load/load.c
src/load/load.h

index 03f511c..0cf2c9a 100644 (file)
@@ -397,7 +397,7 @@ void play_game(player_type *player_ptr, bool new_game, bool browsing_movie)
     }
 
     restore_windows(player_ptr);
-    if (!load_savedata(player_ptr))
+    if (!load_savedata(player_ptr, &new_game))
         quit(_("セーブファイルが壊れています", "broken savefile"));
 
     extract_option_vars();
index 3f6d791..c795407 100644 (file)
@@ -264,7 +264,7 @@ static errr rd_savefile(player_type *player_ptr)
  * @param new_game セーブデータの新規作成が必要か否か
  * @return セーブデータが読み込めればtrue
  */
-bool load_savedata(player_type *player_ptr)
+bool load_savedata(player_type *player_ptr, bool *new_game)
 {
     concptr what = "generic";
     current_world_ptr->game_turn = 0;
@@ -272,10 +272,13 @@ bool load_savedata(player_type *player_ptr)
     if (!savefile[0])
         return TRUE;
 
-#ifndef WINDOWS
+#ifdef WINDOWS
+    (void)new_game;
+#else
     if (access(savefile, 0) < 0) {
         msg_print(_("セーブファイルがありません。", "Savefile does not exist."));
         msg_print(NULL);
+        *new_game = TRUE;
         return TRUE;
     }
 #endif
index d53c6ef..2b53bb7 100644 (file)
@@ -3,4 +3,4 @@
 #include "floor/floor-save.h"
 #include "system/angband.h"
 
-bool load_savedata(player_type *player_ptr);
+bool load_savedata(player_type *player_ptr, bool *new_game);