diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 28fa723786..07f1c26ce7 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -95,9 +95,15 @@ namespace MWClass bool needKey = ptr.getCellRef().mLockLevel>0; bool hasKey = false; std::string keyName; + + // make key id lowercase + std::string keyId = ptr.getCellRef().mKey; + std::transform(keyId.begin(), keyId.end(), keyId.begin(), ::tolower); for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it) { - if (it->getCellRef ().mRefID == ptr.getCellRef().mKey) + std::string refId = it->getCellRef().mRefID; + std::transform(refId.begin(), refId.end(), refId.begin(), ::tolower); + if (refId == keyId) { hasKey = true; keyName = MWWorld::Class::get(*it).getName(*it);