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:
parent
63e27380dc
commit
699d0e9a5e
13 changed files with 569 additions and 248 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue