1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
openmw-tes3mp/apps/openmw/mwclass/weapon.cpp
2010-08-03 14:14:04 +02:00

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