Accept a ConstPtr in getServices

openmw-38
scrawl 9 years ago
parent 648ee6e7fb
commit 09bdb0ad4b

@ -545,9 +545,9 @@ namespace MWClass
return static_cast<float>(stats.getAttribute(0).getModified() * 5);
}
int Creature::getServices(const MWWorld::Ptr &actor) const
int Creature::getServices(const MWWorld::ConstPtr &actor) const
{
MWWorld::LiveCellRef<ESM::Creature>* ref = actor.get<ESM::Creature>();
const MWWorld::LiveCellRef<ESM::Creature>* ref = actor.get<ESM::Creature>();
if (ref->mBase->mHasAI)
return ref->mBase->mAiData.mServices;
else

@ -86,7 +86,7 @@ namespace MWClass
virtual bool isEssential (const MWWorld::ConstPtr& ptr) const;
///< Is \a ptr essential? (i.e. may losing \a ptr make the game unwinnable)
virtual int getServices (const MWWorld::Ptr& actor) const;
virtual int getServices (const MWWorld::ConstPtr& actor) const;
virtual bool isPersistent (const MWWorld::ConstPtr& ptr) const;

@ -1046,9 +1046,9 @@ namespace MWClass
}
int Npc::getServices(const MWWorld::Ptr &actor) const
int Npc::getServices(const MWWorld::ConstPtr &actor) const
{
MWWorld::LiveCellRef<ESM::NPC>* ref = actor.get<ESM::NPC>();
const MWWorld::LiveCellRef<ESM::NPC>* ref = actor.get<ESM::NPC>();
if (ref->mBase->mHasAI)
return ref->mBase->mAiData.mServices;
else

@ -117,7 +117,7 @@ namespace MWClass
virtual bool isEssential (const MWWorld::ConstPtr& ptr) const;
///< Is \a ptr essential? (i.e. may losing \a ptr make the game unwinnable)
virtual int getServices (const MWWorld::Ptr& actor) const;
virtual int getServices (const MWWorld::ConstPtr& actor) const;
virtual bool isPersistent (const MWWorld::ConstPtr& ptr) const;

@ -60,7 +60,7 @@ namespace MWWorld
return false;
}
int Class::getServices(const Ptr &actor) const
int Class::getServices(const ConstPtr &actor) const
{
throw std::runtime_error ("class does not have services");
}

@ -264,7 +264,7 @@ namespace MWWorld
virtual bool canSell (const MWWorld::ConstPtr& item, int npcServices) const;
///< Determine whether or not \a item can be sold to an npc with the given \a npcServices
virtual int getServices (const MWWorld::Ptr& actor) const;
virtual int getServices (const MWWorld::ConstPtr& actor) const;
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

Loading…
Cancel
Save