Explicitly use toLowerAscii for filenames and identifiers

ryzomclassic-develop
kaetemi 4 years ago
parent ae1f4d2df3
commit dc12e2dea3

@ -971,7 +971,7 @@ uint32 AISHEETS::CSheets::getGroupPropertiesIndex(const std::string &groupIndexN
if (groupIndexName.empty()) if (groupIndexName.empty())
return std::numeric_limits<uint32>::max(); return std::numeric_limits<uint32>::max();
std::map<string, uint32>::iterator it = _NameToGroupIndex.find(NLMISC::toUpper(groupIndexName)); std::map<string, uint32>::iterator it = _NameToGroupIndex.find(NLMISC::toUpperAscii(groupIndexName));
if (it==_NameToGroupIndex.end()) if (it==_NameToGroupIndex.end())
{ {
uint32 groupIndex = (uint32)_NameToGroupIndex.size(); uint32 groupIndex = (uint32)_NameToGroupIndex.size();

@ -1134,14 +1134,14 @@ bool CStaticCreatures::applyUserModel(CCustomElementId userModelId, const std::v
splitString(scriptData[i], " ", scriptLine); splitString(scriptData[i], " ", scriptLine);
if (scriptLine.size() < 2 if (scriptLine.size() < 2
|| toLower(scriptLine[0]) == "protect" && scriptLine.size() < 3) || toLowerAscii(scriptLine[0]) == "protect" && scriptLine.size() < 3)
{ {
nlwarning("<CStaticCreatures::applyUserModel> error while reading a script line (uncommented line %i), ignoring it.", i); nlwarning("<CStaticCreatures::applyUserModel> error while reading a script line (uncommented line %i), ignoring it.", i);
errors = true; errors = true;
continue; continue;
} }
switch (attributeMap.find(toLower(scriptLine[0]))) switch (attributeMap.find(toLowerAscii(scriptLine[0])))
{ {
//FIXME: test attributes value before applying, if error set to default value and errors=true //FIXME: test attributes value before applying, if error set to default value and errors=true

@ -102,8 +102,8 @@ void CContinentContainer::loadContinent(string name, string file, sint index, bo
for (its=_SheetMap.begin(); its!=_SheetMap.end(); ++its) for (its=_SheetMap.begin(); its!=_SheetMap.end(); ++its)
{ {
if (NLMISC::toLower((*its).second.Name) == NLMISC::toLower(name+".continent") || if (NLMISC::toLowerAscii((*its).second.Name) == NLMISC::toLowerAscii(name+".continent") ||
NLMISC::toLower((*its).second.PacsRBank) == NLMISC::toLower(name+".rbank")) NLMISC::toLowerAscii((*its).second.PacsRBank) == NLMISC::toLowerAscii(name+".rbank"))
{ {
if (found == _SheetMap.end()) if (found == _SheetMap.end())
{ {
@ -281,14 +281,14 @@ void CContinentContainer::initPacsPrim(const string &path)
for(k=0; k<fileNames.size(); ++k) for(k=0; k<fileNames.size(); ++k)
{ {
// check extension // check extension
if (NLMISC::toLower(CFile::getExtension(fileNames[k])) != "pacs_prim") if (NLMISC::toLowerAscii(CFile::getExtension(fileNames[k])) != "pacs_prim")
{ {
// not a pacs primitive, skip it.. // not a pacs primitive, skip it..
continue; continue;
} }
try try
{ {
string ppName = NLMISC::toLower(CFile::getFilenameWithoutExtension(fileNames[k])); string ppName = NLMISC::toLowerAscii(CFile::getFilenameWithoutExtension(fileNames[k]));
if (_PacsPrimMap.find(ppName) != _PacsPrimMap.end()) if (_PacsPrimMap.find(ppName) != _PacsPrimMap.end())
continue; continue;
@ -365,8 +365,8 @@ void CContinentContainer::loadPacsPrims(const CSheet &sheet, NLPACS::UMoveContai
{ {
TPacsPrimMap::iterator pbIt; TPacsPrimMap::iterator pbIt;
string shapeName = NLMISC::toLower(CFile::getFilenameWithoutExtension(igLoader.getShapeName(k))); string shapeName = NLMISC::toLowerAscii(CFile::getFilenameWithoutExtension(igLoader.getShapeName(k)));
string instanceName = NLMISC::toLower(CFile::getFilenameWithoutExtension(igLoader.getInstanceName(k))); string instanceName = NLMISC::toLowerAscii(CFile::getFilenameWithoutExtension(igLoader.getInstanceName(k)));
bool isTrigger = false; bool isTrigger = false;
bool isZC = false; bool isZC = false;

@ -1244,7 +1244,7 @@ void CScreenshotIslands::loadIslands()
for (map<string, CVector2f>::iterator it(zonePosMap.begin()), end(zonePosMap.end()); it != end; ++it) for (map<string, CVector2f>::iterator it(zonePosMap.begin()), end(zonePosMap.end()); it != end; ++it)
if (it->second.x >= zonelXMin && it->second.x <= zonelXMax if (it->second.x >= zonelXMin && it->second.x <= zonelXMax
&& it->second.y >= zonelYMin && it->second.y <= zonelYMax) && it->second.y >= zonelYMin && it->second.y <= zonelYMax)
island.Zones.push_back(NLMISC::toUpper(it->first)); island.Zones.push_back(NLMISC::toUpperAscii(it->first));
} }
break; break;
} }

Loading…
Cancel
Save