diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-06-08 08:23:48 -0600 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-06-08 20:23:54 +0200 |
commit | 34ca68e13b5ead819f911acdc5aaf35285dde78b (patch) | |
tree | 0cd7ea3829235e22db255605796a237a7d3eab8e /src/being.cpp | |
parent | 4e981ae4679c11221198c6e47160e1d13dd2041f (diff) | |
download | mana-client-34ca68e13b5ead819f911acdc5aaf35285dde78b.tar.gz mana-client-34ca68e13b5ead819f911acdc5aaf35285dde78b.tar.bz2 mana-client-34ca68e13b5ead819f911acdc5aaf35285dde78b.tar.xz mana-client-34ca68e13b5ead819f911acdc5aaf35285dde78b.zip |
Remove duplicate code from Being
(cherry picked from commit c79406e025a17ec29afca2458f916d3f2d49447d)
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/being.cpp b/src/being.cpp index 37cb6987..fa97d800 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1025,19 +1025,6 @@ int Being::getHairStyleCount() return mNumberOfHairstyles; } -int Being::getHairColorCount() -{ - return mNumberOfHairColors; -} - -std::string Being::getHairColor(int index) -{ - if (index < 0 || index >= mNumberOfHairColors) - return "#000000"; - - return hairColors[index]; -} - void Being::load() { // Hairstyles are encoded as negative numbers. Count how far negative @@ -1048,32 +1035,4 @@ void Being::load() hairstyles++; mNumberOfHairstyles = hairstyles; - - XML::Document doc(HAIR_FILE); - xmlNodePtr root = doc.rootNode(); - - // Add an initial hair color - hairColors.resize(1, "#000000"); - - if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) - { - logger->log("Error loading being hair configuration file"); - } else { - for_each_xml_child_node(node, root) - { - if (xmlStrEqual(node->name, BAD_CAST "color")) - { - int index = atoi(XML::getProperty(node, "id", "-1").c_str()); - std::string value = XML::getProperty(node, "value", ""); - - if (index >= 0 && !value.empty()) { - if (index >= mNumberOfHairColors) { - mNumberOfHairColors = index + 1; - hairColors.resize(mNumberOfHairColors, "#000000"); - } - hairColors[index] = value; - } - } - } - } } |