shithub: choc

Download patch

ref: 0fe9bbcffeb7f7fdb032642127cca54b7d965227
parent: a8985916115356fc8e468461aac933b97222c45b
author: Mike Swanson <mikeonthecomputer@gmail.com>
date: Tue Feb 13 20:43:36 EST 2018

When a savegame can't be loaded, exit with an error.

Closes #990, affects Doom, Heretic, Hexen, not Strife.

--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -1553,7 +1553,7 @@
 
     if (save_stream == NULL)
     {
-        return;
+        I_Error ("Could not load savegame");
     }
 
     savegame_error = false;
--- a/src/heretic/p_saveg.c
+++ b/src/heretic/p_saveg.c
@@ -66,6 +66,11 @@
 void SV_OpenRead(char *filename)
 {
     SaveGameFP = fopen(filename, "rb");
+
+    if (SaveGameFP == NULL)
+    {
+        I_Error ("Could not load savegame");
+    }
 }
 
 //==========================================================================
--- a/src/hexen/sv_save.c
+++ b/src/hexen/sv_save.c
@@ -3343,6 +3343,11 @@
 static void SV_OpenRead(char *fileName)
 {
     SavingFP = fopen(fileName, "rb");
+
+    if (SavingFP == NULL)
+    {
+        I_Error ("Could not load savegame");
+    }
 }
 
 static void SV_OpenWrite(char *fileName)