From 92f6b051a5a93bba086c3ef31222aa1f5f531147 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 23 Apr 2020 17:20:56 +0200 Subject: [PATCH] Fall back to sqlite3 if no backend set in world.mt fixes #76 --- TileGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TileGenerator.cpp b/TileGenerator.cpp index e75adc3..ecfe93d 100644 --- a/TileGenerator.cpp +++ b/TileGenerator.cpp @@ -330,11 +330,11 @@ std::set TileGenerator::getSupportedBackends() void TileGenerator::openDb(const std::string &input) { std::string backend = m_backend; - if(backend == "") { - std::ifstream ifs((input + "/world.mt").c_str()); + if (backend == "") { + std::ifstream ifs(input + "/world.mt"); if(!ifs.good()) - throw std::runtime_error("Failed to read world.mt"); - backend = read_setting("backend", ifs); + throw std::runtime_error("Failed to open world.mt"); + backend = read_setting_default("backend", ifs, "sqlite3"); ifs.close(); }