1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Accept a ConstPtr in isEssential

This commit is contained in:
scrawl 2015-12-18 16:39:35 +01:00
parent 4a47fc32fa
commit 3fe3091275
6 changed files with 7 additions and 8 deletions

View File

@ -448,7 +448,7 @@ namespace MWClass
return ref->mBase->mScript;
}
bool Creature::isEssential (const MWWorld::Ptr& ptr) const
bool Creature::isEssential (const MWWorld::ConstPtr& ptr) const
{
return isFlagBitSet(ptr, ESM::Creature::Essential);
}

View File

@ -83,7 +83,7 @@ namespace MWClass
virtual float getArmorRating (const MWWorld::Ptr& ptr) const;
///< @return combined armor rating of this actor
virtual bool isEssential (const MWWorld::Ptr& ptr) const;
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;

View File

@ -908,10 +908,9 @@ namespace MWClass
return ptr.getRefData().getCustomData()->asNpcCustomData().mMovement;
}
bool Npc::isEssential (const MWWorld::Ptr& ptr) const
bool Npc::isEssential (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->mFlags & ESM::NPC::Essential) != 0;
}

View File

@ -114,7 +114,7 @@ namespace MWClass
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor=1.f) const;
///< Inform actor \a ptr that a skill use has succeeded.
virtual bool isEssential (const MWWorld::Ptr& ptr) const;
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;

View File

@ -218,7 +218,7 @@ namespace MWWorld
throw std::runtime_error ("encumbrance not supported by class");
}
bool Class::isEssential (const MWWorld::Ptr& ptr) const
bool Class::isEssential (const MWWorld::ConstPtr& ptr) const
{
return false;
}

View File

@ -229,7 +229,7 @@ namespace MWWorld
///
/// (default implementations: throws an exception)
virtual bool isEssential (const MWWorld::Ptr& ptr) const;
virtual bool isEssential (const MWWorld::ConstPtr& ptr) const;
///< Is \a ptr essential? (i.e. may losing \a ptr make the game unwinnable)
///
/// (default implementation: return false)