mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Bugfix #646
This commit is contained in:
parent
751c679255
commit
d25c838e1d
@ -108,6 +108,46 @@ namespace MWWorld
|
||||
|
||||
}
|
||||
|
||||
//Disable twohanded when shield equipped, shield when twohanded equipped
|
||||
if(*slot == MWWorld::InventoryStore::Slot_CarriedRight)
|
||||
{
|
||||
invStore.equip(*slot, it);
|
||||
|
||||
if (it.getType() == MWWorld::ContainerStore::Type_Weapon)
|
||||
{
|
||||
if(it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::LongBladeTwoHand ||
|
||||
it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::BluntTwoClose ||
|
||||
it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::BluntTwoWide ||
|
||||
it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::SpearTwoWide ||
|
||||
it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::AxeTwoHand ||
|
||||
it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::MarksmanBow ||
|
||||
it->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::MarksmanCrossbow)
|
||||
{
|
||||
//unequip lefthand item
|
||||
invStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, invStore.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(*slot == MWWorld::InventoryStore::Slot_CarriedLeft)
|
||||
{
|
||||
ContainerStoreIterator weapon = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||
|
||||
if (weapon.getType() == MWWorld::ContainerStore::Type_Weapon)
|
||||
{
|
||||
if(weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::LongBladeTwoHand ||
|
||||
weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::BluntTwoClose ||
|
||||
weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::BluntTwoWide ||
|
||||
weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::SpearTwoWide ||
|
||||
weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::AxeTwoHand ||
|
||||
weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::MarksmanBow ||
|
||||
weapon->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::MarksmanCrossbow)
|
||||
{
|
||||
//unequip twohanded item
|
||||
invStore.equip(MWWorld::InventoryStore::Slot_CarriedRight, invStore.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if all slots are occupied, replace the last slot
|
||||
if (slot == --slots.first.end())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user