Chicken egg code early bailout
This commit is contained in:
parent
fd2edf3ecf
commit
1ccf7d9c8a
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user