1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

minecraft-like crafting

This commit is contained in:
Perttu Ahola 2010-12-25 01:54:39 +02:00
parent 63e27380dc
commit 699d0e9a5e
13 changed files with 569 additions and 248 deletions

View file

@ -390,6 +390,20 @@ public:
{
return m_wear;
}
// Returns true if weared out
bool addWear(u16 add)
{
if(m_wear >= 65535 - add)
{
m_wear = 65535;
return true;
}
else
{
m_wear += add;
return false;
}
}
private:
std::string m_toolname;
u16 m_wear;