summaryrefslogtreecommitdiffstats
path: root/source/Entities/ProjectileEntity.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-10-29 22:03:49 +0100
committerMattes D <github@xoft.cz>2013-10-29 22:03:49 +0100
commita0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3 (patch)
treec36b2eb78025d08f08314b86f7a40b831899e6e3 /source/Entities/ProjectileEntity.cpp
parentChanged GameMode() == 1 to IsGameModeCreative in AggressiveMonster.cpp and ClientHandle.cpp (diff)
parentUsing tabs (diff)
downloadcuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.tar
cuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.tar.gz
cuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.tar.bz2
cuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.tar.lz
cuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.tar.xz
cuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.tar.zst
cuberite-a0c2981a3c8f77eb0070dda72f1f7d94ca77e7d3.zip
Diffstat (limited to 'source/Entities/ProjectileEntity.cpp')
-rw-r--r--source/Entities/ProjectileEntity.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/Entities/ProjectileEntity.cpp b/source/Entities/ProjectileEntity.cpp
index 4c8e680d0..1d5532718 100644
--- a/source/Entities/ProjectileEntity.cpp
+++ b/source/Entities/ProjectileEntity.cpp
@@ -474,8 +474,17 @@ cThrownEggEntity::cThrownEggEntity(cEntity * a_Creator, double a_X, double a_Y,
void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
{
- // TODO: Random-spawn a chicken or four
-
+ if (m_World->GetTickRandomNumber(7) == 1)
+ {
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ }
+ else if (m_World->GetTickRandomNumber(32) == 1)
+ {
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, cMonster::mtChicken);
+ }
Destroy();
}