forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'glorf/bugfix'
This commit is contained in:
commit
0856e3ebc2
1 changed files with 38 additions and 0 deletions
|
@ -108,6 +108,44 @@ namespace MWWorld
|
|||
|
||||
}
|
||||
|
||||
//Disable twohanded when shield equipped, shield when twohanded equipped
|
||||
if(*slot == MWWorld::InventoryStore::Slot_CarriedRight)
|
||||
{
|
||||
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…
Reference in a new issue