diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp index 8e4c8f953..f8e4dc40a 100644 --- a/apps/openmw/mwclass/armor.cpp +++ b/apps/openmw/mwclass/armor.cpp @@ -341,13 +341,14 @@ namespace MWClass if(weapon == invStore.end()) return std::make_pair(1,""); - if(weapon->get()->mBase->mData.mType == ESM::Weapon::LongBladeTwoHand || + if(weapon->getTypeName() == typeid(ESM::Weapon).name() && + (weapon->get()->mBase->mData.mType == ESM::Weapon::LongBladeTwoHand || weapon->get()->mBase->mData.mType == ESM::Weapon::BluntTwoClose || weapon->get()->mBase->mData.mType == ESM::Weapon::BluntTwoWide || weapon->get()->mBase->mData.mType == ESM::Weapon::SpearTwoWide || weapon->get()->mBase->mData.mType == ESM::Weapon::AxeTwoHand || weapon->get()->mBase->mData.mType == ESM::Weapon::MarksmanBow || - weapon->get()->mBase->mData.mType == ESM::Weapon::MarksmanCrossbow) + weapon->get()->mBase->mData.mType == ESM::Weapon::MarksmanCrossbow)) { return std::make_pair(3,""); } diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index 090e8ced3..d19da6e2a 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -14,6 +14,7 @@ namespace MWMechanics { Security::Security(const MWWorld::Ptr &actor) + : mActor(actor) { CreatureStats& creatureStats = MWWorld::Class::get(actor).getCreatureStats(actor); NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats(actor); diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index ebc9cd86d..e352b4c82 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -179,7 +179,9 @@ namespace MWWorld // tool used up? if (!item.getRefData().getCount()) - MWBase::Environment::get().getWindowManager()->setSelectedWeapon(MWWorld::Ptr()); + MWBase::Environment::get().getWindowManager()->unsetSelectedWeapon(); + else + MWBase::Environment::get().getWindowManager()->setSelectedWeapon(item); } } }