1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 09:39:51 +00:00

Thrown weapons, arrows and bolts shouldn't have item health

This commit is contained in:
scrawl 2013-03-22 14:28:50 +01:00
parent 20774f8f81
commit 78f3f19f62

View File

@ -75,7 +75,10 @@ namespace MWClass
bool Weapon::hasItemHealth (const MWWorld::Ptr& ptr) const bool Weapon::hasItemHealth (const MWWorld::Ptr& ptr) const
{ {
return true; MWWorld::LiveCellRef<ESM::Weapon> *ref =
ptr.get<ESM::Weapon>();
return (ref->mBase->mData.mType < 11); // thrown weapons and arrows/bolts don't have health, only quantity
} }
int Weapon::getItemMaxHealth (const MWWorld::Ptr& ptr) const int Weapon::getItemMaxHealth (const MWWorld::Ptr& ptr) const