[Client] Make it possible to check whether a class has a ContainerStore

0.6.3
David Cernat 7 years ago
parent 258e319acb
commit ec1311fcb7

@ -36,6 +36,16 @@ namespace MWClass
virtual MWWorld::ContainerStore& getContainerStore (const MWWorld::Ptr& ptr) const;
///< Return container store
/*
Start of tes3mp addition
Make it possible to check whether a class has a container store
*/
virtual bool hasContainerStore(const MWWorld::Ptr &ptr) const { return true; }
/*
End of tes3mp addition
*/
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
///< Return name of the script attached to ptr

@ -73,6 +73,16 @@ namespace MWClass
virtual bool hasInventoryStore (const MWWorld::Ptr &ptr) const;
/*
Start of tes3mp addition
Make it possible to check whether a class has a container store
*/
virtual bool hasContainerStore(const MWWorld::Ptr &ptr) const { return true; }
/*
End of tes3mp addition
*/
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
///< Return name of the script attached to ptr

@ -71,6 +71,16 @@ namespace MWClass
virtual bool hasInventoryStore(const MWWorld::Ptr &ptr) const { return true; }
/*
Start of tes3mp addition
Make it possible to check whether a class has a container store
*/
virtual bool hasContainerStore(const MWWorld::Ptr &ptr) const { return true; }
/*
End of tes3mp addition
*/
virtual void hit(const MWWorld::Ptr& ptr, float attackStrength, int type) const;
virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const;

@ -128,6 +128,19 @@ namespace MWWorld
throw std::runtime_error ("class does not have an inventory store");
}
/*
Start of tes3mp addition
Make it possible to check whether a class has a container store
*/
bool Class::hasContainerStore(const Ptr &ptr) const
{
return false;
}
/*
End of tes3mp addition
*/
bool Class::hasInventoryStore(const Ptr &ptr) const
{
return false;

@ -154,6 +154,17 @@ namespace MWWorld
///< Return inventory store or throw an exception, if class does not have a
/// inventory store (default implementation: throw an exception)
/*
Start of tes3mp addition
Make it possible to check whether a class has a container store
*/
virtual bool hasContainerStore(const Ptr& ptr) const;
///< Does this object have a container store? (default implementation: false)
/*
End of tes3mp addition
*/
virtual bool hasInventoryStore (const Ptr& ptr) const;
///< Does this object have an inventory store, i.e. equipment slots? (default implementation: false)

Loading…
Cancel
Save