From 5c7f9d1d216fd1edca231ed274ac3077cb34909f Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 4 Mar 2024 16:29:14 +0100 Subject: 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 --- src/resources/hairdb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/resources/hairdb.cpp') 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 HairDB::getHairStyleIds(int maxId) const return hairStylesIds; } -std::vector HairDB::getHairColorIds(int maxId) const +std::vector HairDB::getHairColorIds(int minId, int maxId) const { std::vector 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; } -- cgit v1.2.3-70-g09d2