Fix for server not creating new worlds by default

This commit is contained in:
Stephen Kraemer 2013-12-27 13:56:02 -05:00
parent 4b31a38ae9
commit 5ded5dce3f
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}