forked from mirror/openmw-tes3mp
Doors: small key search optimizations
This commit is contained in:
parent
188424d5d3
commit
cab51d26cc
1 changed files with 11 additions and 7 deletions
|
@ -132,15 +132,19 @@ namespace MWClass
|
||||||
|
|
||||||
// make key id lowercase
|
// make key id lowercase
|
||||||
std::string keyId = ptr.getCellRef().getKey();
|
std::string keyId = ptr.getCellRef().getKey();
|
||||||
Misc::StringUtils::lowerCaseInPlace(keyId);
|
if (!keyId.empty())
|
||||||
for (MWWorld::ConstContainerStoreIterator it = invStore.cbegin(); it != invStore.cend(); ++it)
|
|
||||||
{
|
{
|
||||||
std::string refId = it->getCellRef().getRefId();
|
Misc::StringUtils::lowerCaseInPlace(keyId);
|
||||||
Misc::StringUtils::lowerCaseInPlace(refId);
|
for (MWWorld::ConstContainerStoreIterator it = invStore.cbegin(); it != invStore.cend(); ++it)
|
||||||
if (refId == keyId)
|
|
||||||
{
|
{
|
||||||
hasKey = true;
|
std::string refId = it->getCellRef().getRefId();
|
||||||
keyName = it->getClass().getName(*it);
|
Misc::StringUtils::lowerCaseInPlace(refId);
|
||||||
|
if (refId == keyId)
|
||||||
|
{
|
||||||
|
hasKey = true;
|
||||||
|
keyName = it->getClass().getName(*it);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue