mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 09:53:50 +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:
parent
d77d60cbc2
commit
5fbfce6d1e
2 changed files with 21 additions and 7 deletions
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -356,12 +356,19 @@ 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
|
||||
return MWWorld::Ptr();
|
||||
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();
|
||||
}
|
||||
|
||||
void InventoryWindow::unequipItem(const MWWorld::Ptr& item)
|
||||
|
|
Loading…
Reference in a new issue