summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-24 04:42:19 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-24 04:42:19 +0300
commitc52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7 (patch)
treede6e2e30ec40eb49490ab32ef738b64d059d7fbf /src
parentf8cd17e234018066b03b995e92a09981d3d927f8 (diff)
downloadmanaverse-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.tar.gz
manaverse-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.tar.bz2
manaverse-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.tar.xz
manaverse-c52f9d67cb1be0362e490eb1ff23e7bbf3c4a5a7.zip
Fix possible file name conflicts between client data files and skins.
Diffstat (limited to 'src')
-rw-r--r--src/gui/theme.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 0246a5b62..9aa6bb956 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -599,12 +599,17 @@ std::string Theme::resolveThemePath(const std::string &path)
else
file = path;
- // Might be a valid path already
- if (PHYSFS_exists(file.c_str()))
- return path;
+ // File with path
+ if (file.find('/') != std::string::npos)
+ {
+ // Might be a valid path already
+ if (PHYSFS_exists(file.c_str()))
+ return path;
+ }
// Try the theme
file = getThemePath() + "/" + file;
+
if (PHYSFS_exists(file.c_str()))
return getThemePath() + "/" + path;