mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Merge remote-tracking branch 'ragora/bounditemflag'
This commit is contained in:
commit
ea60c665dd
6 changed files with 8 additions and 14 deletions
|
@ -51,7 +51,7 @@ void CompanionWindow::onItemSelected(int index)
|
||||||
const ItemStack& item = mSortModel->getItem(index);
|
const ItemStack& item = mSortModel->getItem(index);
|
||||||
|
|
||||||
// We can't take conjured items from a companion NPC
|
// We can't take conjured items from a companion NPC
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6 && item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
if (item.mFlags & ItemStack::Flag_Bound)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
// We can't drop a conjured item to the ground; the target container should always be the source container
|
// We can't drop a conjured item to the ground; the target container should always be the source container
|
||||||
if (mItem.mBase.getCellRef().getRefId().size() > 6 && mItem.mBase.getCellRef().getRefId().substr(0,6) == "bound_" && targetModel != mSourceModel)
|
if (mItem.mFlags & ItemStack::Flag_Bound && targetModel != mSourceModel)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
||||||
return;
|
return;
|
||||||
|
@ -184,7 +184,7 @@ namespace MWGui
|
||||||
const ItemStack& item = mSortModel->getItem(index);
|
const ItemStack& item = mSortModel->getItem(index);
|
||||||
|
|
||||||
// We can't take a conjured item from a container (some NPC we're pickpocketing, a box, etc)
|
// We can't take a conjured item from a container (some NPC we're pickpocketing, a box, etc)
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6 && item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
if (item.mFlags & ItemStack::Flag_Bound)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sContentsMessage1}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sContentsMessage1}");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -62,7 +62,7 @@ void InventoryItemModel::removeItem (const ItemStack& item, size_t count)
|
||||||
MWWorld::Ptr InventoryItemModel::moveItem(const ItemStack &item, size_t count, ItemModel *otherModel)
|
MWWorld::Ptr InventoryItemModel::moveItem(const ItemStack &item, size_t count, ItemModel *otherModel)
|
||||||
{
|
{
|
||||||
// Can't move conjured items: This is a general fix that also takes care of issues with taking conjured items via the 'Take All' button.
|
// Can't move conjured items: This is a general fix that also takes care of issues with taking conjured items via the 'Take All' button.
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6 && item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
if (item.mFlags & ItemStack::Flag_Bound)
|
||||||
return MWWorld::Ptr();
|
return MWWorld::Ptr();
|
||||||
|
|
||||||
bool setNewOwner = false;
|
bool setNewOwner = false;
|
||||||
|
|
|
@ -189,8 +189,8 @@ namespace MWGui
|
||||||
|
|
||||||
if (mTrading)
|
if (mTrading)
|
||||||
{
|
{
|
||||||
// Can't give cojured items to a merchant
|
// Can't give conjured items to a merchant
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6 && item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
if (item.mFlags & ItemStack::Flag_Bound)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog9}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog9}");
|
||||||
|
|
|
@ -45,11 +45,8 @@ namespace MWGui
|
||||||
const ItemStack& item = mSourceModel->getItem(i);
|
const ItemStack& item = mSourceModel->getItem(i);
|
||||||
|
|
||||||
// Bound items may not be stolen
|
// Bound items may not be stolen
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6
|
if (item.mFlags & ItemStack::Flag_Bound)
|
||||||
&& item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (std::find(mHiddenItems.begin(), mHiddenItems.end(), item) == mHiddenItems.end()
|
if (std::find(mHiddenItems.begin(), mHiddenItems.end(), item) == mHiddenItems.end()
|
||||||
&& item.mType != ItemStack::Type_Equipped)
|
&& item.mType != ItemStack::Type_Equipped)
|
||||||
|
|
|
@ -169,11 +169,8 @@ namespace MWGui
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Bound items may not be bought
|
// Bound items may not be bought
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6
|
if (item.mFlags & ItemStack::Flag_Bound)
|
||||||
&& item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// don't show equipped items
|
// don't show equipped items
|
||||||
if(mMerchant.getClass().hasInventoryStore(mMerchant))
|
if(mMerchant.getClass().hasInventoryStore(mMerchant))
|
||||||
|
|
Loading…
Reference in a new issue