From 1561da21ef34bab48a5e145e32dd7fe7280b5edd Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sun, 3 Apr 2011 06:53:05 +0100 Subject: [PATCH] Fixed World activation from resources --- storage/storage.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/storage/storage.cpp b/storage/storage.cpp index 6e77d5ae3c..8e83079acb 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -71,6 +71,19 @@ namespace storage LOG(LWARNING, (e.what(), "while adding file", *it, "so this file is deleted")); } } + // separate code to activate world data file from resources + // if it's not found in writable data dir + Platform::FilesList::iterator found = std::find(filesList.begin(), filesList.end(), + string(WORLD_FILE_NAME DATA_FILE_EXTENSION)); + if (found == filesList.end()) + { + try { + m_addMap(p.ReadPathForFile(WORLD_FILE_NAME DATA_FILE_EXTENSION)); + } catch (std::exception const & e) + { + LOG(LWARNING, (e.what(), "while adding world data file")); + } + } } string Storage::UpdateBaseUrl() const