1
0

Properly exported cItemFrame and cHangingEntity to Lua.

This commit is contained in:
Mattes D
2014-10-21 22:02:30 +02:00
parent 881bc66233
commit a42fa071bc
10 changed files with 100 additions and 67 deletions

View File

@@ -9,10 +9,10 @@
cItemFrame::cItemFrame(eBlockFace a_BlockFace, double a_X, double a_Y, double a_Z)
: cHangingEntity(etItemFrame, a_BlockFace, a_X, a_Y, a_Z)
, m_Item(E_BLOCK_AIR)
, m_Rotation(0)
cItemFrame::cItemFrame(eBlockFace a_BlockFace, double a_X, double a_Y, double a_Z) :
cHangingEntity(etItemFrame, a_BlockFace, a_X, a_Y, a_Z),
m_Item(E_BLOCK_AIR),
m_ItemRotation(0)
{
}
@@ -27,10 +27,10 @@ void cItemFrame::OnRightClicked(cPlayer & a_Player)
if (!m_Item.IsEmpty())
{
// Item not empty, rotate, clipping values to zero to three inclusive
m_Rotation++;
if (m_Rotation >= 8)
m_ItemRotation++;
if (m_ItemRotation >= 8)
{
m_Rotation = 0;
m_ItemRotation = 0;
}
}
else if (!a_Player.GetEquippedItem().IsEmpty())
@@ -72,7 +72,7 @@ void cItemFrame::KilledBy(TakeDamageInfo & a_TDI)
SetHealth(GetMaxHealth());
m_Item.Empty();
m_Rotation = 0;
m_ItemRotation = 0;
SetInvulnerableTicks(0);
GetWorld()->BroadcastEntityMetadata(*this);
}