@ -281,6 +281,7 @@ namespace MWClass
newItem.mEnchant=enchId;
const ESM::Armor *record = MWBase::Environment::get().getWorld()->createRecord (newItem);
ref->mBase = record;
ref->mRef.mRefID = record->mId;
}
std::pair<int, std::string> Armor::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const
@ -171,6 +171,7 @@ namespace MWClass
const ESM::Book *record = MWBase::Environment::get().getWorld()->createRecord (newItem);
boost::shared_ptr<MWWorld::Action> Book::use (const MWWorld::Ptr& ptr) const
@ -227,6 +227,7 @@ namespace MWClass
const ESM::Clothing *record = MWBase::Environment::get().getWorld()->createRecord (newItem);
std::pair<int, std::string> Clothing::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const
@ -370,16 +370,17 @@ namespace MWClass
void Weapon::applyEnchantment(const MWWorld::Ptr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const
{
MWWorld::LiveCellRef<ESM::Weapon> *ref =
ptr.get<ESM::Weapon>();
ESM::Weapon newItem = *ref->mBase;
newItem.mId="";
newItem.mName=newName;
newItem.mData.mEnchant=enchCharge;
const ESM::Weapon *record = MWBase::Environment::get().getWorld()->createRecord (newItem);
std::pair<int, std::string> Weapon::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const