From a08d5f1a39d740766aa1afb6a74dd479a9b25a35 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 13 Dec 2014 13:22:28 +0100 Subject: Fixed leaves drop chance. --- src/Blocks/BlockLeaves.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h index bd9a7414e..db3d682a1 100644 --- a/src/Blocks/BlockLeaves.h +++ b/src/Blocks/BlockLeaves.h @@ -38,10 +38,15 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - cFastRandom rand; + cFastRandom Rand; + int DropChance = 20; + if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_JUNGLE)) + { + DropChance = 40; + } // Old leaves - 3 bits contain display; new leaves - 1st bit, shifted left two for saplings to understand - if (rand.NextInt(6) == 0) + if (Rand.NextInt(DropChance) == 0) { a_Pickups.push_back( cItem( @@ -52,10 +57,10 @@ public: ); } - // 1 % chance of dropping an apple, if the leaves' type is Apple Leaves + // 0.5 % chance of dropping an apple, if the leaves' type is Apple Leaves if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_APPLE)) { - if (rand.NextInt(101) == 0) + if (Rand.NextInt(200) == 0) { a_Pickups.push_back(cItem(E_ITEM_RED_APPLE, 1, 0)); } -- cgit v1.2.3