1
0

Baby chickens don't lay eggs

This commit is contained in:
Gargaj 2015-12-16 17:45:07 +01:00 committed by Safwat Halaby
parent 2b27bf9f22
commit fd2edf3ecf

View File

@ -24,23 +24,26 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
if ((m_EggDropTimer == 6000) && (m_World->GetTickRandomNumber(1) == 0))
if (!IsBaby())
{
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++;
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++;
}
}
}