1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 12:23:53 +00:00

Accept a ConstPtr in isPersistent

This commit is contained in:
scrawl 2015-12-18 16:41:37 +01:00
parent 3fe3091275
commit 3c98f8dde3
6 changed files with 8 additions and 8 deletions

View file

@ -554,9 +554,9 @@ namespace MWClass
return 0;
}
bool Creature::isPersistent(const MWWorld::Ptr &actor) const
bool Creature::isPersistent(const MWWorld::ConstPtr &actor) const
{
MWWorld::LiveCellRef<ESM::Creature>* ref = actor.get<ESM::Creature>();
const MWWorld::LiveCellRef<ESM::Creature>* ref = actor.get<ESM::Creature>();
return ref->mBase->mPersistent;
}

View file

@ -88,7 +88,7 @@ namespace MWClass
virtual int getServices (const MWWorld::Ptr& actor) const;
virtual bool isPersistent (const MWWorld::Ptr& ptr) const;
virtual bool isPersistent (const MWWorld::ConstPtr& ptr) const;
virtual std::string getSoundIdFromSndGen(const MWWorld::Ptr &ptr, const std::string &name) const;

View file

@ -419,9 +419,9 @@ namespace MWClass
renderingInterface.getObjects().insertNPC(ptr);
}
bool Npc::isPersistent(const MWWorld::Ptr &actor) const
bool Npc::isPersistent(const MWWorld::ConstPtr &actor) const
{
MWWorld::LiveCellRef<ESM::NPC>* ref = actor.get<ESM::NPC>();
const MWWorld::LiveCellRef<ESM::NPC>* ref = actor.get<ESM::NPC>();
return ref->mBase->mPersistent;
}

View file

@ -119,7 +119,7 @@ namespace MWClass
virtual int getServices (const MWWorld::Ptr& actor) const;
virtual bool isPersistent (const MWWorld::Ptr& ptr) const;
virtual bool isPersistent (const MWWorld::ConstPtr& ptr) const;
virtual std::string getSoundIdFromSndGen(const MWWorld::Ptr &ptr, const std::string &name) const;

View file

@ -241,7 +241,7 @@ namespace MWWorld
return *iter->second;
}
bool Class::isPersistent(const Ptr &ptr) const
bool Class::isPersistent(const ConstPtr &ptr) const
{
throw std::runtime_error ("class does not support persistence");
}

View file

@ -277,7 +277,7 @@ namespace MWWorld
virtual float getWeight (const MWWorld::ConstPtr& ptr) const;
virtual bool isPersistent (const MWWorld::Ptr& ptr) const;
virtual bool isPersistent (const MWWorld::ConstPtr& ptr) const;
virtual bool isKey (const MWWorld::ConstPtr& ptr) const { return false; }