From bd054ea7769291bd03454b55f736ed01c709f1e8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 14 Feb 2015 17:54:05 +0100 Subject: [PATCH] Fixed: Warning multichars --HG-- branch : hotfix --- code/ryzom/client/src/hair_set.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/ryzom/client/src/hair_set.cpp b/code/ryzom/client/src/hair_set.cpp index d82733162..5d44e2857 100644 --- a/code/ryzom/client/src/hair_set.cpp +++ b/code/ryzom/client/src/hair_set.cpp @@ -45,20 +45,20 @@ void CHairSet::init (NLMISC::IProgressCallback &progress) progress.progress ((float)k/(float)numHairItem); const CItemSheet *item = SheetMngr.getItem(SLOTTYPE::HEAD_SLOT, k); - if( (item) && (!item->getShape().empty()) ) + if (item && !item->getShape().empty()) { - std::string itemName = NLMISC::toLower(item->getShape()); - if (item->getShape().find("cheveux", 0) != std::string::npos) { // get race - uint16 race = (uint16) itemName[1] | ((uint16) itemName[0] << 8); - switch(race) + std::string itemName = NLMISC::toLower(item->getShape()); + + // fortunately, first character of each race is distinct + switch(itemName[0]) { - case 'ma': _Hairs[Matis].push_back(k); break; - case 'tr': _Hairs[Tryker].push_back(k); break; - case 'zo': _Hairs[Zorai].push_back(k); break; - case 'fy': _Hairs[Fyros].push_back(k); break; + case 'm': _Hairs[Matis].push_back(k); break; + case 't': _Hairs[Tryker].push_back(k); break; + case 'z': _Hairs[Zorai].push_back(k); break; + case 'f': _Hairs[Fyros].push_back(k); break; } } }