From ede07f93b245c18bfab4aae31748c2b95bb46a23 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 3 Mar 2016 11:11:25 +0100 Subject: [PATCH] - fixed: Failure to open bots.cfg would throw an exception that prevented the level from starting. Catch it in FCajunMaster::LoadBots instead and handle it non-disruptively. --- src/b_game.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/b_game.cpp b/src/b_game.cpp index be827eaca..9681aa7a8 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -60,6 +60,7 @@ Everything that is changed is marked (maybe commented) with "Added by MC" #include "d_net.h" #include "d_netinf.h" #include "d_player.h" +#include "doomerrors.h" static FRandom pr_botspawn ("BotSpawn"); @@ -496,7 +497,15 @@ bool FCajunMaster::LoadBots () DPrintf ("No " BOTFILENAME ", so no bots\n"); return false; } - sc.OpenFile(tmp); + try + { + sc.OpenFile(tmp); + } + catch (CRecoverableError &err) + { + Printf("%s. So no bots\n", err.GetMessage()); + return false; + } while (sc.GetString ()) {