Accept a ConstPtr in getBaseFightRating

openmw-38
scrawl 9 years ago
parent d120f76031
commit 92a3acfa56

@ -770,9 +770,9 @@ namespace MWClass
store.restock(list, ptr, ptr.getCellRef().getRefId());
}
int Creature::getBaseFightRating(const MWWorld::Ptr &ptr) const
int Creature::getBaseFightRating(const MWWorld::ConstPtr &ptr) const
{
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
const MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
return ref->mBase->mAiData.mFight;
}

@ -129,7 +129,7 @@ namespace MWClass
virtual void restock (const MWWorld::Ptr &ptr) const;
virtual int getBaseFightRating(const MWWorld::Ptr &ptr) const;
virtual int getBaseFightRating(const MWWorld::ConstPtr &ptr) const;
virtual void adjustScale(const MWWorld::Ptr& ptr, osg::Vec3f& scale, bool rendering) const;
/// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh

@ -1236,9 +1236,9 @@ namespace MWClass
store.restock(list, ptr, ptr.getCellRef().getRefId());
}
int Npc::getBaseFightRating (const MWWorld::Ptr& ptr) const
int Npc::getBaseFightRating (const MWWorld::ConstPtr& ptr) const
{
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
return ref->mBase->mAiData.mFight;
}

@ -167,7 +167,7 @@ namespace MWClass
virtual void restock (const MWWorld::Ptr& ptr) const;
virtual int getBaseFightRating (const MWWorld::Ptr& ptr) const;
virtual int getBaseFightRating (const MWWorld::ConstPtr& ptr) const;
virtual std::string getPrimaryFaction(const MWWorld::Ptr &ptr) const;
virtual int getPrimaryFactionRank(const MWWorld::Ptr &ptr) const;

@ -433,7 +433,7 @@ namespace MWWorld
return std::string();
}
int Class::getBaseFightRating(const Ptr &ptr) const
int Class::getBaseFightRating(const ConstPtr &ptr) const
{
throw std::runtime_error("class does not support fight rating");
}

@ -338,7 +338,7 @@ namespace MWWorld
/// Returns sound id
virtual std::string getSound(const MWWorld::ConstPtr& ptr) const;
virtual int getBaseFightRating (const MWWorld::Ptr& ptr) const;
virtual int getBaseFightRating (const MWWorld::ConstPtr& ptr) const;
virtual std::string getPrimaryFaction (const MWWorld::Ptr& ptr) const;
virtual int getPrimaryFactionRank (const MWWorld::Ptr& ptr) const;

Loading…
Cancel
Save