summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Chicken.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2017-10-21 18:55:46 +0200
committerAlexander Harkness <me@bearbin.net>2017-10-21 18:55:46 +0200
commite585595ae64cc5523547c95cb8bebeb8e60f141b (patch)
tree846fb44a8699cf7a739e18c69490e46ab788b382 /src/Mobs/Chicken.cpp
parentFix minecart deceleration (#4059) (diff)
downloadcuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.gz
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.bz2
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.lz
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.xz
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.tar.zst
cuberite-e585595ae64cc5523547c95cb8bebeb8e60f141b.zip
Diffstat (limited to 'src/Mobs/Chicken.cpp')
-rw-r--r--src/Mobs/Chicken.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp
index 1068295e6..e2caa6f67 100644
--- a/src/Mobs/Chicken.cpp
+++ b/src/Mobs/Chicken.cpp
@@ -10,7 +10,7 @@
cChicken::cChicken(void) :
- super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.3, 0.4),
+ super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.4, 0.7),
m_EggDropTimer(0)
{
SetGravity(-2.0f);
@@ -34,14 +34,10 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
return; // Babies don't lay eggs
}
- if ((m_EggDropTimer == 6000) && GetRandomProvider().RandBool())
- {
- 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)
+ if (
+ ((m_EggDropTimer == 6000) && GetRandomProvider().RandBool()) ||
+ m_EggDropTimer == 12000
+ )
{
cItems Drops;
m_EggDropTimer = 0;
@@ -60,6 +56,11 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
+ if (IsBaby())
+ {
+ return; // Babies don't drop items
+ }
+
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{