summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-15 02:15:39 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-15 02:15:39 +0300
commit67ca22e33cc7227048121895bec75e546a3777ef (patch)
tree08d897013784943f435265d99638dd96e7d9d7b5 /src/resources
parent60019d36cc08faa4d49f2ddb048f6a71cf87a683 (diff)
downloadmanaverse-67ca22e33cc7227048121895bec75e546a3777ef.tar.gz
manaverse-67ca22e33cc7227048121895bec75e546a3777ef.tar.bz2
manaverse-67ca22e33cc7227048121895bec75e546a3777ef.tar.xz
manaverse-67ca22e33cc7227048121895bec75e546a3777ef.zip
improve colordb class.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/colordb.cpp5
-rw-r--r--src/resources/colordb.h3
-rw-r--r--src/resources/iteminfo.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp
index d664b2d5b..42669b700 100644
--- a/src/resources/colordb.cpp
+++ b/src/resources/colordb.cpp
@@ -120,7 +120,7 @@ void ColorDB::loadColorLists()
{
if (xmlNameEqual(node, "list"))
{
- std::string name = XML::getProperty(node, "name", "");
+ const std::string name = XML::getProperty(node, "name", "");
if (name.empty())
continue;
@@ -185,7 +185,8 @@ int ColorDB::getHairSize()
return mHairColorsSize;
}
-std::map <int, ColorDB::ItemColor> *ColorDB::getColorsList(std::string name)
+const std::map <int, ColorDB::ItemColor>
+ *ColorDB::getColorsList(const std::string &name)
{
const ColorListsIterator it = mColorLists.find(name);
diff --git a/src/resources/colordb.h b/src/resources/colordb.h
index 75fff94a3..d39abbe9d 100644
--- a/src/resources/colordb.h
+++ b/src/resources/colordb.h
@@ -75,7 +75,8 @@ namespace ColorDB
int getHairSize() A_WARN_UNUSED;
- std::map <int, ItemColor> *getColorsList(std::string name) A_WARN_UNUSED;
+ const std::map <int, ItemColor> *getColorsList(const std::string
+ &name) A_WARN_UNUSED;
// Color DB
typedef std::map<int, ItemColor> Colors;
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index afea431ee..380624b7b 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -330,7 +330,7 @@ class ItemInfo final
/** Stores the names of sounds to be played at certain event. */
std::map <EquipmentSoundEvent, StringVect> mSounds;
std::map <int, int> mTags;
- std::map <int, ColorDB::ItemColor> *mColors;
+ const std::map <int, ColorDB::ItemColor> *mColors;
std::string mColorList;
int mHitEffectId;
int mCriticalHitEffectId;