diff options
author | tonibm19 <tonibm19@gmail.com> | 2013-10-28 20:57:04 +0100 |
---|---|---|
committer | tonibm19 <tonibm19@gmail.com> | 2013-10-28 20:57:04 +0100 |
commit | 8c9fa9cf35aebc82e213766191914285098923e5 (patch) | |
tree | 08e35b7ae5f3a63ce2572b69f11a0721d6e54e43 | |
parent | Now saddled horses spawn a saddle pickup when killed (diff) | |
download | cuberite-8c9fa9cf35aebc82e213766191914285098923e5.tar cuberite-8c9fa9cf35aebc82e213766191914285098923e5.tar.gz cuberite-8c9fa9cf35aebc82e213766191914285098923e5.tar.bz2 cuberite-8c9fa9cf35aebc82e213766191914285098923e5.tar.lz cuberite-8c9fa9cf35aebc82e213766191914285098923e5.tar.xz cuberite-8c9fa9cf35aebc82e213766191914285098923e5.tar.zst cuberite-8c9fa9cf35aebc82e213766191914285098923e5.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Entities/ProjectileEntity.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/Entities/ProjectileEntity.cpp b/source/Entities/ProjectileEntity.cpp index 4c8e680d0..e33066ab0 100644 --- a/source/Entities/ProjectileEntity.cpp +++ b/source/Entities/ProjectileEntity.cpp @@ -247,6 +247,8 @@ void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFac SetPosition(a_HitPos); SetSpeed(0, 0, 0); + + // DEBUG: LOGD("Projectile %d: pos {%.02f, %.02f, %.02f}, hit solid block at face %d", m_UniqueID, @@ -474,8 +476,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(); } |