From d90df299a09c4525975808c8e6039936b916dc67 Mon Sep 17 00:00:00 2001 From: Deskull Date: Thu, 29 May 2014 14:49:44 +0900 Subject: [PATCH] Add assertion. --- Deeangband/GameSurfaceSDL.cpp | 6 +++++- Deeangband/GameWorld.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Deeangband/GameSurfaceSDL.cpp b/Deeangband/GameSurfaceSDL.cpp index fc3f10f..b3a6c1d 100644 --- a/Deeangband/GameSurfaceSDL.cpp +++ b/Deeangband/GameSurfaceSDL.cpp @@ -90,7 +90,11 @@ namespace Deeangband color.b = 200; color.a = 255; - if(!font) exit(1); + if(!font) + { + OutputDebugString(L"Failed: loading .ttf files.\n"); + exit(1); + } rwop = SDL_RWFromFile("img\\Title.png", "rb"); error = IMG_GetError(); diff --git a/Deeangband/GameWorld.cpp b/Deeangband/GameWorld.cpp index 132a9cd..56923b5 100644 --- a/Deeangband/GameWorld.cpp +++ b/Deeangband/GameWorld.cpp @@ -17,6 +17,7 @@ namespace Deeangband { Dice::Initialize(); XMLLoad(); + dungeonList.emplace("VANILLA_WOMB", boost::make_shared(0, SPECIAL_TAG_UNKNOWN, this)); floorList.emplace(0, boost::make_shared(0, SPECIAL_TAG_UNKNOWN, this, &(*dungeonList["VANILLA_WOMB"]), 1)); creatureList.emplace(0, boost::make_shared(0, SPECIAL_TAG_UNKNOWN, this)); @@ -200,6 +201,7 @@ namespace Deeangband bool GameWorld::xmlLoadAuthority() { std::ifstream ifs("lib-vanilla\\Authority.xml"); + assert(ifs); boost::archive::xml_iarchive ia(ifs); ia >> BOOST_SERIALIZATION_NVP(authorityList); return true; -- 2.11.0