Fixed indentation and re-styled conditions.

This commit is contained in:
madmaxoft 2013-10-18 16:34:01 +02:00
parent 2a9997881c
commit 5d4fa298d3

View File

@ -78,7 +78,10 @@ void cHorse::Tick(float a_Dt, cChunk & a_Chunk)
m_bIsRearing = false; m_bIsRearing = false;
m_RearTickCount = 0; m_RearTickCount = 0;
} }
else { m_RearTickCount++;} else
{
m_RearTickCount++;
}
} }
m_World->BroadcastEntityMetadata(*this); m_World->BroadcastEntityMetadata(*this);
@ -90,22 +93,25 @@ void cHorse::Tick(float a_Dt, cChunk & a_Chunk)
void cHorse::OnRightClicked(cPlayer & a_Player) void cHorse::OnRightClicked(cPlayer & a_Player)
{ {
if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_SADDLE) && (!m_bIsSaddled) && (m_bIsTame)) if (!m_bIsSaddled && m_bIsTame)
{ {
if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_SADDLE)
{
// Saddle the horse:
if (!a_Player.IsGameModeCreative()) if (!a_Player.IsGameModeCreative())
{ {
a_Player.GetInventory().RemoveOneEquippedItem(); a_Player.GetInventory().RemoveOneEquippedItem();
} }
// Set saddle state & broadcast metadata
m_bIsSaddled = true; m_bIsSaddled = true;
m_World->BroadcastEntityMetadata(*this); m_World->BroadcastEntityMetadata(*this);
} }
else if ((a_Player.GetEquippedItem().m_ItemType != E_ITEM_EMPTY) && (!m_bIsSaddled) && (!m_bIsTame)) else if (!a_Player.GetEquippedItem().IsEmpty())
{ {
// The horse doesn't like being hit, make it rear:
m_bIsRearing = true; m_bIsRearing = true;
m_RearTickCount = 0; m_RearTickCount = 0;
} }
}
else else
{ {
if (m_Attachee != NULL) if (m_Attachee != NULL)