1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:23:52 +00:00

Don't show WerewolfRobe objects in the inventory

Pretty ugly hard-coding, but this is likely what vanilla does since it
has no option to mark clothes or armor as unplayable like Oblivion does.
This commit is contained in:
Chris Robinson 2013-08-08 16:05:26 -07:00
parent d77d60cbc2
commit 5fbfce6d1e
2 changed files with 21 additions and 7 deletions

View file

@ -75,7 +75,14 @@ void InventoryItemModel::update()
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
{
ItemStack newItem (*it, this, it->getRefData().getCount());
MWWorld::Ptr item = *it;
// NOTE: Don't show WerewolfRobe objects in the inventory, or allow them to be taken.
// Vanilla likely uses a hack like this since there's no other way to prevent it from
// being shown or taken.
if(item.getCellRef().mRefID == "WerewolfRobe")
continue;
ItemStack newItem (item, this, item.getRefData().getCount());
if (mActor.getTypeName() == typeid(ESM::NPC).name())
{

View file

@ -356,11 +356,18 @@ namespace MWGui
if (slot == -1)
return MWWorld::Ptr();
MWWorld::Ptr player = mPtr;
MWWorld::InventoryStore& invStore = MWWorld::Class::get(player).getInventoryStore(player);
if (invStore.getSlot(slot) != invStore.end())
return *invStore.getSlot (slot);
else
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
if(invStore.getSlot(slot) != invStore.end())
{
MWWorld::Ptr item = *invStore.getSlot(slot);
// NOTE: Don't allow users to select WerewolfRobe objects in the inventory. Vanilla
// likely uses a hack like this since there's no other way to prevent it from being
// taken.
if(item.getCellRef().mRefID == "WerewolfRobe")
return MWWorld::Ptr();
return item;
}
return MWWorld::Ptr();
}