Accept a ConstPtr in isClass

openmw-38
scrawl 9 years ago
parent 5b082be79f
commit 2ac92012e8

@ -1201,7 +1201,7 @@ namespace MWClass
return ref->mBase->mNpdt12.mGold; return ref->mBase->mNpdt12.mGold;
} }
bool Npc::isClass(const MWWorld::Ptr& ptr, const std::string &className) const bool Npc::isClass(const MWWorld::ConstPtr& ptr, const std::string &className) const
{ {
return Misc::StringUtils::ciEqual(ptr.get<ESM::NPC>()->mBase->mClass, className); return Misc::StringUtils::ciEqual(ptr.get<ESM::NPC>()->mBase->mClass, className);
} }

@ -150,7 +150,7 @@ namespace MWClass
virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const; virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;
virtual bool isClass(const MWWorld::Ptr& ptr, const std::string &className) const; virtual bool isClass(const MWWorld::ConstPtr& ptr, const std::string &className) const;
virtual bool canSwim (const MWWorld::ConstPtr &ptr) const; virtual bool canSwim (const MWWorld::ConstPtr &ptr) const;

@ -404,7 +404,7 @@ namespace MWWorld
throw std::runtime_error("class does not support base gold"); throw std::runtime_error("class does not support base gold");
} }
bool Class::isClass(const MWWorld::Ptr& ptr, const std::string &className) const bool Class::isClass(const MWWorld::ConstPtr& ptr, const std::string &className) const
{ {
return false; return false;
} }

@ -322,7 +322,7 @@ namespace MWWorld
virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const; virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;
virtual bool isClass(const MWWorld::Ptr& ptr, const std::string &className) const; virtual bool isClass(const MWWorld::ConstPtr& ptr, const std::string &className) const;
/// 0 = nothing, 1 = opening, 2 = closing /// 0 = nothing, 1 = opening, 2 = closing
virtual int getDoorState (const MWWorld::Ptr &ptr) const; virtual int getDoorState (const MWWorld::Ptr &ptr) const;

Loading…
Cancel
Save