Renaming item health to item damage
#1
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.
Reply
Thanks given by:
#2
Yea, you can even use a unionTongue

Code:
union
{
   short m_ItemDamage, m_ItemHealth;
};

And they will be the same thingBig Grin
Reply
Thanks given by:
#3
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?
Reply
Thanks given by:
#4
This works, because ToLua does not need to know about the union
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)