From 59d5b42abf1e716027c0fdf10d076912e0ce1454 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 5 Oct 2016 19:02:53 +0200 Subject: [PATCH] - fixed: G_UnsnapshotLevel should abort with an error if it cannot read the savegame. - fixed: The exception handler in G_DoLoadGame needs to rethrow the exception it receives. --- src/g_game.cpp | 2 +- src/g_level.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index 629202ea5b..48bda24f5f 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1999,7 +1999,7 @@ void G_DoLoadGame () { // delete the resource file if anything goes wrong in here. if (resfile != nullptr) delete resfile; - return; + throw; } } diff --git a/src/g_level.cpp b/src/g_level.cpp index 90b31138d2..119cde378d 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1512,7 +1512,11 @@ void G_UnSnapshotLevel (bool hubLoad) if (level.info->isValid()) { FSerializer arc; - if (!arc.OpenReader(&level.info->Snapshot)) return; + if (!arc.OpenReader(&level.info->Snapshot)) + { + I_Error("Failed to load savegame"); + return; + } G_SerializeLevel (arc, hubLoad); level.FromSnapshot = true;