From 17919a843d9b20595651b712e664a6d796b59898 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 Jan 2014 15:14:57 +0300 Subject: delete legacy config file loading (colors.xml). For now always loaded only hair.xml. --- src/defaults.cpp | 1 - src/resources/db/colordb.cpp | 25 +++++-------------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/defaults.cpp b/src/defaults.cpp index 5e55ff98b..89ecae779 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -484,7 +484,6 @@ DefaultsData* getPathsDefaults() AddDEF("equipmentWindowFile", "equipmentwindow.xml"); AddDEF("emotesFile", "emotes.xml"); AddDEF("hairColorFile", "hair.xml"); - AddDEF("hairColorFile2", "colors.xml"); AddDEF("itemColorsFile", "itemcolors.xml"); AddDEF("charCreationFile", "charcreation.xml"); AddDEF("soundsFile", "sounds.xml"); diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp index 759226e84..e3ab56672 100644 --- a/src/resources/db/colordb.cpp +++ b/src/resources/db/colordb.cpp @@ -52,6 +52,7 @@ void ColorDB::load() mHairColorsSize = static_cast((*it).second.size()); else mHairColorsSize = 0; + mLoaded = true; } void ColorDB::loadHair() @@ -69,25 +70,11 @@ void ColorDB::loadHair() if (!root || !xmlNameEqual(root, "colors")) { - logger->log("Trying to fall back on " - + paths.getStringValue("hairColorFile2")); - - hairXml = false; - - delete doc; - doc = new XML::Document(paths.getStringValue("hairColorFile2")); - root = doc->rootNode(); - - if (!root || !xmlNameEqual(root, "colors")) - { - logger->log1("ColorDB: Failed to find any color files."); + logger->log("ColorDB: Failed to find hair colors file."); + if (colors.find(0) == colors.end()) colors[0] = ItemColor(0, "", ""); - mLoaded = true; - - delete doc; - - return; - } + delete doc; + return; } for_each_xml_child_node(node, root) @@ -105,9 +92,7 @@ void ColorDB::loadHair() } delete doc; - mColorLists["hair"] = colors; - mLoaded = true; } void ColorDB::loadColorLists() -- cgit v1.2.3-70-g09d2