From 5ded5dce3f89c8e44fc54430648c52a420269021 Mon Sep 17 00:00:00 2001 From: Stephen Kraemer Date: Fri, 27 Dec 2013 13:56:02 -0500 Subject: [PATCH] Fix for server not creating new worlds by default --- src/rollback.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rollback.cpp b/src/rollback.cpp index bae81ddb0..35aa56a4e 100644 --- a/src/rollback.cpp +++ b/src/rollback.cpp @@ -257,6 +257,9 @@ void SQL_databaseCheck(void) infostream << "Database connection setup" << std::endl; bool needsCreate = !fs::PathExists(dbp); + if (needsCreate) { + fs::CreateAllDirs(fs::RemoveLastPathComponent(dbp)); + } int dbo = sqlite3_open_v2(dbp.c_str(), &dbh, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); @@ -1156,4 +1159,3 @@ IRollbackManager *createRollbackManager(const std::string &filepath, IGameDef *g { return new RollbackManager(filepath, gamedef); } -