1
0

Chicken egg code early bailout

This commit is contained in:
Safwat Halaby 2015-12-23 15:57:26 +02:00
parent fd2edf3ecf
commit 1ccf7d9c8a

View File

@ -24,26 +24,28 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
if (!IsBaby())
if (IsBaby())
{
if ((m_EggDropTimer == 6000) && (m_World->GetTickRandomNumber(1) == 0))
{
cItems Drops;
m_EggDropTimer = 0;
Drops.push_back(cItem(E_ITEM_EGG, 1));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
}
else if (m_EggDropTimer == 12000)
{
cItems Drops;
m_EggDropTimer = 0;
Drops.push_back(cItem(E_ITEM_EGG, 1));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
}
else
{
m_EggDropTimer++;
}
return; // Babies don't lay eggs
}
if ((m_EggDropTimer == 6000) && (m_World->GetTickRandomNumber(1) == 0))
{
cItems Drops;
m_EggDropTimer = 0;
Drops.push_back(cItem(E_ITEM_EGG, 1));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
}
else if (m_EggDropTimer == 12000)
{
cItems Drops;
m_EggDropTimer = 0;
Drops.push_back(cItem(E_ITEM_EGG, 1));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
}
else
{
m_EggDropTimer++;
}
}