From 360d8eade0332f2c1aa5c205ca772cd506c35b26 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Tue, 13 Jun 2017 20:35:30 +0100 Subject: FastRandom rewrite (#3754) --- src/Blocks/BlockPlant.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Blocks/BlockPlant.h') diff --git a/src/Blocks/BlockPlant.h b/src/Blocks/BlockPlant.h index 0155dc466..d7c5d9f83 100644 --- a/src/Blocks/BlockPlant.h +++ b/src/Blocks/BlockPlant.h @@ -75,10 +75,9 @@ protected: */ virtual PlantAction CanGrow(cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) { - cFastRandom rand; // Plant can grow if it has the required amount of light, and it passes a random chance based on surrounding blocks PlantAction Action = HasEnoughLight(a_Chunk, a_RelX, a_RelY, a_RelZ); - if ((Action == paGrowth) && (rand.NextInt(GetGrowthChance(a_Chunk, a_RelX, a_RelY, a_RelZ)) != 0)) + if ((Action == paGrowth) && !GetRandomProvider().RandBool(1.0 / GetGrowthChance(a_Chunk, a_RelX, a_RelY, a_RelZ))) { Action = paStay; } -- cgit v1.2.3