diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-03 02:21:07 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-03 02:21:07 +0200 |
commit | 8627c7745f47492ab349da6a74e98e3d5813418f (patch) | |
tree | 8c6abbe632dfb91e856e06fadcbbac1b72f25416 | |
parent | 22f79fd0d623c8e11994905534f53da267e22935 (diff) | |
download | manaverse-8627c7745f47492ab349da6a74e98e3d5813418f.tar.gz manaverse-8627c7745f47492ab349da6a74e98e3d5813418f.tar.bz2 manaverse-8627c7745f47492ab349da6a74e98e3d5813418f.tar.xz manaverse-8627c7745f47492ab349da6a74e98e3d5813418f.zip |
Add some protections to disable advanced features for old servers like tmw.
-rw-r--r-- | src/resources/colordb.cpp | 5 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 79622e8ed..dce051403 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -20,6 +20,7 @@ #include "resources/colordb.h" +#include "client.h" #include "log.h" #include "utils/xml.h" @@ -40,7 +41,8 @@ void ColorDB::load() unload(); loadHair(); - loadColorLists(); + if (serverVersion >= 1) + loadColorLists(); } void ColorDB::loadHair() @@ -132,6 +134,7 @@ void ColorDB::unload() logger->log1("Unloading color database..."); mHairColors.clear(); + mColorLists.clear(); mLoaded = false; } diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index d515495de..4ba254cf3 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -22,6 +22,7 @@ #include "resources/itemdb.h" +#include "client.h" #include "log.h" #include "resources/iteminfo.h" @@ -207,7 +208,11 @@ void ItemDB::load() std::string drawBefore = XML::getProperty(node, "drawBefore", ""); std::string drawAfter = XML::getProperty(node, "drawAfter", ""); std::string removeSprite = XML::getProperty(node, "removeSprite", ""); - std::string colors = XML::getProperty(node, "colors", ""); + std::string colors; + if (serverVersion >= 1) + colors = XML::getProperty(node, "colors", ""); + else + colors = ""; std::string tags[3]; tags[0] = XML::getProperty(node, "tag", |