mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-25 15:11:33 +00:00
Implement MagicItems flag for vendors (Fixes #1861)
This commit is contained in:
parent
0da4757ee6
commit
59720b7dc6
4 changed files with 8 additions and 4 deletions
|
@ -380,7 +380,8 @@ namespace MWClass
|
||||||
|
|
||||||
bool Armor::canSell (const MWWorld::Ptr& item, int npcServices) const
|
bool Armor::canSell (const MWWorld::Ptr& item, int npcServices) const
|
||||||
{
|
{
|
||||||
return npcServices & ESM::NPC::Armor;
|
return (npcServices & ESM::NPC::Armor)
|
||||||
|
|| ((npcServices & ESM::NPC::MagicItems) && !getEnchantment(item).empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Armor::getWeight(const MWWorld::Ptr &ptr) const
|
float Armor::getWeight(const MWWorld::Ptr &ptr) const
|
||||||
|
|
|
@ -202,7 +202,8 @@ namespace MWClass
|
||||||
|
|
||||||
bool Book::canSell (const MWWorld::Ptr& item, int npcServices) const
|
bool Book::canSell (const MWWorld::Ptr& item, int npcServices) const
|
||||||
{
|
{
|
||||||
return npcServices & ESM::NPC::Books;
|
return (npcServices & ESM::NPC::Books)
|
||||||
|
|| ((npcServices & ESM::NPC::MagicItems) && !getEnchantment(item).empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Book::getWeight(const MWWorld::Ptr &ptr) const
|
float Book::getWeight(const MWWorld::Ptr &ptr) const
|
||||||
|
|
|
@ -292,7 +292,8 @@ namespace MWClass
|
||||||
|
|
||||||
bool Clothing::canSell (const MWWorld::Ptr& item, int npcServices) const
|
bool Clothing::canSell (const MWWorld::Ptr& item, int npcServices) const
|
||||||
{
|
{
|
||||||
return npcServices & ESM::NPC::Clothing;
|
return (npcServices & ESM::NPC::Clothing)
|
||||||
|
|| ((npcServices & ESM::NPC::MagicItems) && !getEnchantment(item).empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Clothing::getWeight(const MWWorld::Ptr &ptr) const
|
float Clothing::getWeight(const MWWorld::Ptr &ptr) const
|
||||||
|
|
|
@ -434,7 +434,8 @@ namespace MWClass
|
||||||
|
|
||||||
bool Weapon::canSell (const MWWorld::Ptr& item, int npcServices) const
|
bool Weapon::canSell (const MWWorld::Ptr& item, int npcServices) const
|
||||||
{
|
{
|
||||||
return npcServices & ESM::NPC::Weapon;
|
return (npcServices & ESM::NPC::Weapon)
|
||||||
|
|| ((npcServices & ESM::NPC::MagicItems) && !getEnchantment(item).empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
float Weapon::getWeight(const MWWorld::Ptr &ptr) const
|
float Weapon::getWeight(const MWWorld::Ptr &ptr) const
|
||||||
|
|
Loading…
Reference in a new issue