Accept a ConstPtr in getEnchantment

openmw-38
scrawl 9 years ago
parent beb8805a12
commit 2bc851c7d3

@ -258,10 +258,9 @@ namespace MWClass
return info;
}
std::string Armor::getEnchantment (const MWWorld::Ptr& ptr) const
std::string Armor::getEnchantment (const MWWorld::ConstPtr& ptr) const
{
MWWorld::LiveCellRef<ESM::Armor> *ref =
ptr.get<ESM::Armor>();
const MWWorld::LiveCellRef<ESM::Armor> *ref = ptr.get<ESM::Armor>();
return ref->mBase->mEnchant;
}

@ -67,7 +67,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;
virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
virtual std::string applyEnchantment(const MWWorld::Ptr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;

@ -146,10 +146,9 @@ namespace MWClass
return info;
}
std::string Book::getEnchantment (const MWWorld::Ptr& ptr) const
std::string Book::getEnchantment (const MWWorld::ConstPtr& ptr) const
{
MWWorld::LiveCellRef<ESM::Book> *ref =
ptr.get<ESM::Book>();
const MWWorld::LiveCellRef<ESM::Book> *ref = ptr.get<ESM::Book>();
return ref->mBase->mEnchant;
}

@ -51,7 +51,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;
virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
virtual std::string applyEnchantment(const MWWorld::Ptr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;

@ -200,10 +200,9 @@ namespace MWClass
return info;
}
std::string Clothing::getEnchantment (const MWWorld::Ptr& ptr) const
std::string Clothing::getEnchantment (const MWWorld::ConstPtr& ptr) const
{
MWWorld::LiveCellRef<ESM::Clothing> *ref =
ptr.get<ESM::Clothing>();
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
return ref->mBase->mEnchant;
}

@ -59,7 +59,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;
virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
virtual std::string applyEnchantment(const MWWorld::Ptr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;

@ -347,10 +347,9 @@ namespace MWClass
return info;
}
std::string Weapon::getEnchantment (const MWWorld::Ptr& ptr) const
std::string Weapon::getEnchantment (const MWWorld::ConstPtr& ptr) const
{
MWWorld::LiveCellRef<ESM::Weapon> *ref =
ptr.get<ESM::Weapon>();
const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
return ref->mBase->mEnchant;
}

@ -65,7 +65,7 @@ namespace MWClass
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;
virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
virtual std::string applyEnchantment(const MWWorld::Ptr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;

@ -282,7 +282,7 @@ namespace MWWorld
return false;
}
std::string Class::getEnchantment (const Ptr& ptr) const
std::string Class::getEnchantment (const ConstPtr& ptr) const
{
return "";
}

@ -251,7 +251,7 @@ namespace MWWorld
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;
virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
/// (default implementation: return empty string)

Loading…
Cancel
Save