1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 00:45:32 +00:00

Make MWWorld::getInterior case insensitive.

Interior cells names can use different mix of uppercase/lowercase in different places.
getInterior() should return same cell in all cases. Fixes bug #586.
This commit is contained in:
Michal Sciubidlo 2013-03-07 20:15:01 +01:00
parent f680fba37e
commit f2f4b6e2d5

View file

@ -129,13 +129,14 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getExterior (int x, int y)
MWWorld::Ptr::CellStore *MWWorld::Cells::getInterior (const std::string& name)
{
std::map<std::string, Ptr::CellStore>::iterator result = mInteriors.find (name);
std::string lowerName = Misc::StringUtils::lowerCase(name);
std::map<std::string, Ptr::CellStore>::iterator result = mInteriors.find (lowerName);
if (result==mInteriors.end())
{
const ESM::Cell *cell = mStore.get<ESM::Cell>().find(name);
const ESM::Cell *cell = mStore.get<ESM::Cell>().find(lowerName);
result = mInteriors.insert (std::make_pair (name, Ptr::CellStore (cell))).first;
result = mInteriors.insert (std::make_pair (lowerName, Ptr::CellStore (cell))).first;
}
if (result->second.mState!=Ptr::CellStore::State_Loaded)