mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 03:14:06 +00:00
Added checks to verifier for container inventories
This commit is contained in:
parent
db7b80b503
commit
4c14117761
1 changed files with 35 additions and 0 deletions
|
@ -398,6 +398,41 @@ void CSMTools::ReferenceableCheckStage::containerCheck(
|
||||||
if (container.mName.empty())
|
if (container.mName.empty())
|
||||||
messages.push_back (std::make_pair (id, container.mId + " has an empty name"));
|
messages.push_back (std::make_pair (id, container.mId + " has an empty name"));
|
||||||
|
|
||||||
|
//checking contained items
|
||||||
|
const std::vector<ESM::ContItem>& itemList = container.mInventory.mList;
|
||||||
|
for (unsigned i = 0; i < itemList.size(); ++i)
|
||||||
|
{
|
||||||
|
std::string itemName = itemList[i].mItem.toString();
|
||||||
|
CSMWorld::RefIdData::LocalIndex localIndex = mReferencables.searchId(itemName);
|
||||||
|
|
||||||
|
if (localIndex.first == -1)
|
||||||
|
messages.push_back (std::make_pair (id,
|
||||||
|
container.mId + " contains unreferenced item " + itemName));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (localIndex.second)
|
||||||
|
{
|
||||||
|
case CSMWorld::UniversalId::Type_Potion:
|
||||||
|
case CSMWorld::UniversalId::Type_Apparatus:
|
||||||
|
case CSMWorld::UniversalId::Type_Armor:
|
||||||
|
case CSMWorld::UniversalId::Type_Book:
|
||||||
|
case CSMWorld::UniversalId::Type_Clothing:
|
||||||
|
case CSMWorld::UniversalId::Type_Ingredient:
|
||||||
|
case CSMWorld::UniversalId::Type_Light:
|
||||||
|
case CSMWorld::UniversalId::Type_Lockpick:
|
||||||
|
case CSMWorld::UniversalId::Type_Miscellaneous:
|
||||||
|
case CSMWorld::UniversalId::Type_Probe:
|
||||||
|
case CSMWorld::UniversalId::Type_Repair:
|
||||||
|
case CSMWorld::UniversalId::Type_Weapon:
|
||||||
|
case CSMWorld::UniversalId::Type_ItemLevelledList:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
messages.push_back (std::make_pair(id,
|
||||||
|
container.mId + " contains illegal item " + itemName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check that mentioned scripts exist
|
// Check that mentioned scripts exist
|
||||||
scriptCheck<ESM::Container>(container, messages, id.toString());
|
scriptCheck<ESM::Container>(container, messages, id.toString());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue