Cuberite Forum

Full Version: Renaming item health to item damage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,
I believe it would be a change for the better to rename cItem:m_ItemHealth to cItem:m_ItemDamage. Because that's what the value really is - a value of 0 specifies an undamaged item and increasing the number degrades the item.

I believe I can make the change incremental - first add the m_ItemDamage variable, providing the same value as m_ItemHealth, and then later remove the m_ItemHealth variable, when the plugins have adjusted.
Yea, you can even use a unionTongue

Code:
union
{
   short m_ItemDamage, m_ItemHealth;
};

And they will be the same thingBig Grin
I'm not sure if tolua would eat that, I was planning on renaming it in C++ and adding the m_ItemHealth binding to ManualBindings. But hey, if it works this simply, why not?
This works, because ToLua does not need to know about the union