forked from mirror/openmw-tes3mp
Appears to have resolved the issue with unequipping conjured items and all possible error conditions deriving from being able to unequip them
This commit is contained in:
parent
d64be1c092
commit
141755b473
2 changed files with 16 additions and 9 deletions
|
@ -113,6 +113,14 @@ namespace MWGui
|
||||||
std::string sound = mItem.mBase.getClass().getDownSoundId(mItem.mBase);
|
std::string sound = mItem.mBase.getClass().getDownSoundId(mItem.mBase);
|
||||||
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 though if it's somehow not on your
|
||||||
|
// person and you're trying to take it, this would display the wrong message. (Dropping rather than taking).
|
||||||
|
if (mItem.mBase.getCellRef().getRefId().size() > 6 && mItem.mBase.getCellRef().getRefId().substr(0,6) == "bound_" && targetModel != mSourceModel)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If item is dropped where it was taken from, we don't need to do anything -
|
// If item is dropped where it was taken from, we don't need to do anything -
|
||||||
// otherwise, do the transfer
|
// otherwise, do the transfer
|
||||||
if (targetModel != mSourceModel)
|
if (targetModel != mSourceModel)
|
||||||
|
|
|
@ -183,21 +183,20 @@ namespace MWGui
|
||||||
MWWorld::Ptr object = item.mBase;
|
MWWorld::Ptr object = item.mBase;
|
||||||
int count = item.mCount;
|
int count = item.mCount;
|
||||||
|
|
||||||
// Bound items may not be moved
|
|
||||||
if (item.mBase.getCellRef().getRefId().size() > 6
|
|
||||||
&& item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool shift = MyGUI::InputManager::getInstance().isShiftPressed();
|
bool shift = MyGUI::InputManager::getInstance().isShiftPressed();
|
||||||
if (MyGUI::InputManager::getInstance().isControlPressed())
|
if (MyGUI::InputManager::getInstance().isControlPressed())
|
||||||
count = 1;
|
count = 1;
|
||||||
|
|
||||||
if (mTrading)
|
if (mTrading)
|
||||||
{
|
{
|
||||||
|
// Can't give bound items to a merchant
|
||||||
|
if (item.mBase.getCellRef().getRefId().size() > 6 && item.mBase.getCellRef().getRefId().substr(0,6) == "bound_")
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog9}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check if merchant accepts item
|
// check if merchant accepts item
|
||||||
int services = MWBase::Environment::get().getWindowManager()->getTradeWindow()->getMerchantServices();
|
int services = MWBase::Environment::get().getWindowManager()->getTradeWindow()->getMerchantServices();
|
||||||
if (!object.getClass().canSell(object, services))
|
if (!object.getClass().canSell(object, services))
|
||||||
|
|
Loading…
Reference in a new issue