forked from teamnwah/openmw-tes3coop
Accept a ConstPtr in getEnchantmentPoints
This commit is contained in:
parent
303521002d
commit
c43f80633a
10 changed files with 14 additions and 18 deletions
|
@ -371,10 +371,9 @@ namespace MWClass
|
|||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
||||
int Armor::getEnchantmentPoints (const MWWorld::Ptr& ptr) const
|
||||
int Armor::getEnchantmentPoints (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->mData.mEnchant;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace MWClass
|
|||
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
virtual bool canSell (const MWWorld::ConstPtr& item, int npcServices) const;
|
||||
|
||||
|
|
|
@ -179,10 +179,9 @@ namespace MWClass
|
|||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
||||
int Book::getEnchantmentPoints (const MWWorld::Ptr& ptr) const
|
||||
int Book::getEnchantmentPoints (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->mData.mEnchant;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace MWClass
|
|||
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
virtual float getWeight (const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
|
|
|
@ -264,10 +264,9 @@ namespace MWClass
|
|||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
||||
int Clothing::getEnchantmentPoints (const MWWorld::Ptr& ptr) const
|
||||
int Clothing::getEnchantmentPoints (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->mData.mEnchant;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace MWClass
|
|||
|
||||
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
virtual float getWeight (const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
|
|
|
@ -405,10 +405,9 @@ namespace MWClass
|
|||
return MWWorld::Ptr(cell.insert(ref), &cell);
|
||||
}
|
||||
|
||||
int Weapon::getEnchantmentPoints (const MWWorld::Ptr& ptr) const
|
||||
int Weapon::getEnchantmentPoints (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->mData.mEnchant;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace MWClass
|
|||
|
||||
virtual float getWeight (const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ namespace MWWorld
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Class::getEnchantmentPoints (const MWWorld::Ptr& ptr) const
|
||||
int Class::getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
throw std::runtime_error ("class does not support enchanting");
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace MWWorld
|
|||
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
|
||||
/// (default implementation: return empty string)
|
||||
|
||||
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
|
||||
virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
|
||||
///< @return the number of enchantment points available for possible enchanting
|
||||
|
||||
virtual void adjustScale(const MWWorld::ConstPtr& ptr, osg::Vec3f& scale, bool rendering) const;
|
||||
|
|
Loading…
Reference in a new issue