mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
32 lines
644 B
C++
32 lines
644 B
C++
|
|
#include "weapon.hpp"
|
|
|
|
#include <components/esm/loadweap.hpp>
|
|
|
|
#include <components/esm_store/cell_store.hpp>
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
namespace MWClass
|
|
{
|
|
bool Weapon::hasItemHealth (const MWWorld::Ptr& ptr) const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
int Weapon::getItemMaxHealth (const MWWorld::Ptr& ptr) const
|
|
{
|
|
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
|
ptr.get<ESM::Weapon>();
|
|
|
|
return ref->base->data.health;
|
|
}
|
|
|
|
void Weapon::registerSelf()
|
|
{
|
|
boost::shared_ptr<Class> instance (new Weapon);
|
|
|
|
registerClass (typeid (ESM::Weapon).name(), instance);
|
|
}
|
|
}
|