summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockTallGrass.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockTallGrass.h')
-rw-r--r--src/Blocks/BlockTallGrass.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Blocks/BlockTallGrass.h b/src/Blocks/BlockTallGrass.h
index f0da32cf5..d43d3ad04 100644
--- a/src/Blocks/BlockTallGrass.h
+++ b/src/Blocks/BlockTallGrass.h
@@ -37,12 +37,15 @@ private:
return cItem(m_BlockType, 1, a_BlockMeta);
}
- // Drop seeds, sometimes:
- if (GetRandomProvider().RandBool(0.125))
+ // Drop seeds, depending on bernoulli trial result:
+ if (GetRandomProvider().RandBool(0.875)) // 87.5% chance of dropping nothing
{
- return cItem(E_ITEM_SEEDS);
+ return {};
}
- return {};
+
+ // 12.5% chance of dropping 0 or more seeds.
+ const auto DropNum = FortuneDiscreteRandom(1, 1, 2 * ToolFortuneLevel(a_Tool));
+ return cItem(E_ITEM_SEEDS, DropNum);
}