|
|
@ -3,6 +3,7 @@
|
|
|
|
#include <components/esm/loadlock.hpp>
|
|
|
|
#include <components/esm/loadlock.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
|
|
|
|
#include "../mwbase/mechanicsmanager.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
|
|
|
|
|
|
|
@ -155,6 +156,16 @@ namespace MWClass
|
|
|
|
return MWWorld::Ptr(cell.insert(ref), &cell);
|
|
|
|
return MWWorld::Ptr(cell.insert(ref), &cell);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::pair<int, std::string> Lockpick::canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Do not allow equip tools from inventory during attack
|
|
|
|
|
|
|
|
if (MWBase::Environment::get().getMechanicsManager()->isAttackingOrSpell(npc)
|
|
|
|
|
|
|
|
&& MWBase::Environment::get().getWindowManager()->isGuiMode())
|
|
|
|
|
|
|
|
return std::make_pair(0, "#{sCantEquipWeapWarning}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return std::make_pair(1, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Lockpick::canSell (const MWWorld::ConstPtr& item, int npcServices) const
|
|
|
|
bool Lockpick::canSell (const MWWorld::ConstPtr& item, int npcServices) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (npcServices & ESM::NPC::Picks) != 0;
|
|
|
|
return (npcServices & ESM::NPC::Picks) != 0;
|
|
|
|