1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwclass/weapon.cpp
2010-08-03 14:14:04 +02:00

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);
}
}