aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/gamebase/GameBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base_tab/gamebase/GameBase.cpp')
-rw-r--r--src/base_tab/gamebase/GameBase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/base_tab/gamebase/GameBase.cpp b/src/base_tab/gamebase/GameBase.cpp
index e8f9a59..4c7c1a3 100644
--- a/src/base_tab/gamebase/GameBase.cpp
+++ b/src/base_tab/gamebase/GameBase.cpp
@@ -4,8 +4,9 @@
std::shared_ptr<GameBase> OpenDatabase(const std::string &dbpath, bool createIfNotExist){
wxFileName file(dbpath);
wxString ext = file.GetExt().Lower();
+ bool create=createIfNotExist && !file.Exists();
if (ext == "pgn") {
- if(createIfNotExist && !file.Exists())
+ if(create)
PGNGameBase::CreateDatabaseFile(dbpath);
return std::shared_ptr<GameBase>(new PGNGameBase(dbpath));
}