summaryrefslogtreecommitdiff
path: root/src/resources/hairdb.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-04 16:29:14 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-04 20:20:52 +0100
commit5c7f9d1d216fd1edca231ed274ac3077cb34909f (patch)
tree234405f8f9d0b422a02d8cc44854aaa6992cf2d9 /src/resources/hairdb.cpp
parentd5ebad4e74da011777f9ba1a13fbb37d18c827b9 (diff)
downloadmana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.tar.gz
mana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.tar.bz2
mana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.tar.xz
mana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.zip
Fixed character display
This change fixes hair style to take into account "race", which makes the faces visible again. Hair colors should also be fixed now, with partial support for itemcolors.xml added. The Mana client now also supports per-character gender, and it now hides the hair style and color buttons on character creation, when there are none to choose from. Closes #43
Diffstat (limited to 'src/resources/hairdb.cpp')
-rw-r--r--src/resources/hairdb.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resources/hairdb.cpp b/src/resources/hairdb.cpp
index ff301a23..09ac14f4 100644
--- a/src/resources/hairdb.cpp
+++ b/src/resources/hairdb.cpp
@@ -104,15 +104,15 @@ std::vector<int> HairDB::getHairStyleIds(int maxId) const
return hairStylesIds;
}
-std::vector<int> HairDB::getHairColorIds(int maxId) const
+std::vector<int> HairDB::getHairColorIds(int minId, int maxId) const
{
std::vector<int> hairColorsIds;
- for (const auto &hairColor : mHairColors)
+ for (const auto &[id, _] : mHairColors)
{
// Don't give ids higher than the requested maximum.
- if (maxId > 0 && hairColor.first > maxId)
+ if ((maxId > 0 && id > maxId) || id < minId)
continue;
- hairColorsIds.push_back(hairColor.first);
+ hairColorsIds.push_back(id);
}
return hairColorsIds;
}